The timeout to use when the request has been upgraded and a write is happening
334908
public static void setCustomPropertyVariables() {
        
        UPGRADE_READ_TIMEOUT = Integer.valueOf(customProps.getProperty("upgradereadtimeout", Integer.toString(TCPReadRequestContext.NO_TIMEOUT))).intValue();
        UPGRADE_WRITE_TIMEOUT = Integer.valueOf(customProps.getProperty("upgradewritetimeout", Integer.toString(TCPReadRequestContext.NO_TIMEOUT))).intValue();
    }
6597
def encode_request(timeout, durability, transaction_type, thread_id):
    
    client_message = ClientMessage(payload_size=calculate_size(timeout, durability, transaction_type, thread_id))
    client_message.set_message_type(REQUEST_TYPE)
    client_message.set_retryable(RETRYABLE)
    client_message.append_long(timeout)
    client_message.append_int(durability)
    client_message.append_int(transaction_type)
    client_message.append_long(thread_id)
    client_message.update_frame_length()
    return client_message
626062
public final void increaseWrittenBytes(int increment, long currentTime) {
        if (increment <= 0) {
            return;
        }

        writtenBytes += increment;
        lastWriteTime = currentTime;
        idleCountForBoth.set(0);
        idleCountForWrite.set(0);

        if (getService() instanceof AbstractIoService) {
            getService().getStatistics().increaseWrittenBytes(increment, currentTime);
        }

        increaseScheduledWriteBytes(-increment);
    }
671237
function setTimeouts($read = null, $write = null)
    {
        $this->xmlrpcClient->setTimeouts($read, $write);
    }
435826
@Override
    public long processSyncWriteRequest(long numBytes, int timeout) throws IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "processSyncRequest(" + numBytes + "," + timeout + ")");
        }

        long numUserBytesWritten = 0; // no. of user bytes written

        if (numBytes != 0) {
            if (this.blockWait == null) {
                this.blockWait = new SimpleSync();
            }
            this.blockingIOError = null;

            // before we write, signal that we want to do the write ourselves
            // and not the worker threads.
            this.blockedThread = true;

            VirtualConnection vc = writeInternal(numBytes, null, false, timeout);

            while (vc == null) {
                // block until we are told to write
                this.blockWait.simpleWait();

                if (this.blockingIOError == null) {
                    vc = ((NioTCPChannel) getTCPConnLink().getTCPChannel()).getWorkQueueManager().processWork(this, 1);
                } else {
                    break;
                }
            }

            this.blockedThread = false;
            if (this.blockingIOError != null) {
                throw this.blockingIOError;
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "getIOCompleteAmount() -->" + String.valueOf(getIOCompleteAmount()));
            }
            numUserBytesWritten = getIOCompleteAmount();
        } else {
            WsByteBuffer buffers[] = getBuffers();
            NioSocketIOChannel channel = (NioSocketIOChannel) getTCPConnLink().getSocketIOChannel();
            if (buffers.length == 1) {
                numUserBytesWritten = channel.write(buffers[0].getWrappedByteBufferNonSafe());
            } else {
                numUserBytesWritten = channel.write(getByteBufferArray());
            }
        }

        // return the number of bytes written
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "processSyncRequest", Long.valueOf(numUserBytesWritten));
        }
        return (numUserBytesWritten);
    }
1084425
function timeout(message) {
    $log.warn('Plugin client request timeout: ' + serialize(message));

    var promiseIndex = lodash.findIndex(promises, function(promise) {
      return promise.id == message.header.id;
    });

    if (promiseIndex >= 0) {
      var promise = lodash.pullAt(promises, promiseIndex);

      message.response = {
        statusCode: 408,
        statusText: 'REQUEST_TIMED_OUT',
        data: {
          message: 'Request timed out.'
        }
      }
      promise[0].onComplete(message);
    } else {
      $log.warn('Message request timed out but there is no promise to fulfill: ' + serialize(message));
    }
  }
1337794
def _flushBuffer(self, request):
        ''''''
        assert request is self.requestSession.request
        self.requestSession.writeData(self.buffer)
        self.buffer = []
478266
public void updateThroughput(long currentTime) {
        synchronized (throughputCalculationLock) {
            int interval = (int) (currentTime - lastThroughputCalculationTime);
            long minInterval = getThroughputCalculationIntervalInMillis();
            if (minInterval == 0 || interval < minInterval) {
                return;
            }

            long readBytes = this.readBytes.get();
            long writtenBytes = this.writtenBytes.get();
            long readMessages = this.readMessages.get();
            long writtenMessages = this.writtenMessages.get();

            readBytesThroughput = (readBytes - lastReadBytes) * 1000.0
                    / interval;
            writtenBytesThroughput = (writtenBytes - lastWrittenBytes) * 1000.0
                    / interval;
            readMessagesThroughput = (readMessages - lastReadMessages) * 1000.0
                    / interval;
            writtenMessagesThroughput = (writtenMessages - lastWrittenMessages)
                    * 1000.0 / interval;

            if (readBytesThroughput > largestReadBytesThroughput) {
                largestReadBytesThroughput = readBytesThroughput;
            }
            if (writtenBytesThroughput > largestWrittenBytesThroughput) {
                largestWrittenBytesThroughput = writtenBytesThroughput;
            }
            if (readMessagesThroughput > largestReadMessagesThroughput) {
                largestReadMessagesThroughput = readMessagesThroughput;
            }
            if (writtenMessagesThroughput > largestWrittenMessagesThroughput) {
                largestWrittenMessagesThroughput = writtenMessagesThroughput;
            }

            lastReadBytes = readBytes;
            lastWrittenBytes = writtenBytes;
            lastReadMessages = readMessages;
            lastWrittenMessages = writtenMessages;

            lastThroughputCalculationTime = currentTime;
        }
    }
1332526
@Override
  public void write(JsonWriter out, MarkTiming markTiming) throws IOException {
    out.beginArray();

    out.value(markTiming.getMark());
    out.value(markTiming.getTime());

    out.endArray();
    out.flush();
  }
656531
public final boolean tryLockForWrite(L locker, long timeout, TimeUnit unit)
        throws InterruptedException
    {
        if (Thread.interrupted()) {
            throw new InterruptedException();
        }
        if (!tryLockForWrite(locker)) {
            long start = System.nanoTime();
            Result upgradeResult = tryLockForUpgrade_(locker, timeout, unit);
            if (upgradeResult == Result.FAILED) {
                return false;
            }
            if (!tryLockForWrite(locker)) {
                unlockFromUpgrade(locker);
                if ((timeout = unit.toNanos(timeout) - (System.nanoTime() - start)) <= 0) {
                    return false;
                }
                if (!lockForWriteQueuedInterruptibly(locker, addWriteWaiter(), timeout)) {
                    return false;
                }
            }
            if (upgradeResult == Result.ACQUIRED) {
                // clear upgrade state bit to indicate automatic upgrade
                while (!clearUpgradeLock(mState)) {}
            } else {
                // undo automatic upgrade count increment
                mUpgradeCount--;
            }
        }
        return true;
    }
1183775
public void waitUntilAllWritten(int timeout) throws ExternalFrameConfirmationException {
        final AutoBuffer confirmAb = new AutoBuffer(channel);
        try {
            byte flag = ExternalFrameConfirmationCheck.getConfirmation(confirmAb, timeout);
            assert (flag == ExternalFrameHandler.CONFIRM_WRITING_DONE);
        } catch (TimeoutException ex) {
            throw new ExternalFrameConfirmationException("Timeout for confirmation exceeded!");
        } catch (InterruptedException e) {
            throw new ExternalFrameConfirmationException("Confirmation thread interrupted!");
        } catch (ExecutionException e) {
            throw new ExternalFrameConfirmationException("Confirmation failed!");
        }
    }
571415
void refresh() {
    // Request latest expressions from the server
    try {
      HttpResponse res = client.get(uri)
          .withConnectTimeout(connectTimeout)
          .withReadTimeout(readTimeout)
          .addHeader("If-None-Match", etag)
          .send()
          .decompress();
      if (res.status() == 304) {
        LOGGER.debug("no modification to subscriptions");
      } else if (res.status() != 200) {
        LOGGER.warn("failed to update subscriptions, received status {}", res.status());
      } else {
        etag = res.header("ETag");
        payload = filterByStep(mapper.readValue(res.entity(), Subscriptions.class));
      }
    } catch (Exception e) {
      LOGGER.warn("failed to update subscriptions (uri={})", uri, e);
    }

    // Update with the current payload, it will be null if there hasn't been a single
    // successful request
    if (payload != null) {
      long now = clock.wallTime();
      payload.update(subscriptions, now, now + configTTL);
    }
  }
782006
def _on_timeout(self, info: str = None) -> None:
        
        self._timeout = None
        error_message = "Timeout {0}".format(info) if info else "Timeout"
        if self.final_callback is not None:
            self._handle_exception(
                HTTPTimeoutError, HTTPTimeoutError(error_message), None
            )
1096283
def write_done(self, addr):
        """"""
        if not addr == self._current_addr:
            logger.warning(
                'Address did not match when adding data to read request!')
            return

        if len(self._data) > 0:
            self._current_addr += self._addr_add
            self._write_new_chunk()
            return False
        else:
            logger.debug('This write request is done')
            return True
713303
void writeFinished(Object error) {
        checkThread();
        writingBuffer = null;
        Promise wp = this.writePromise;
        writePromise = null;
        if ( ! wp.isSettled() ) {
            if ( error != null )
                wp.reject(error);
            else
                wp.resolve();
        }
    }
709206
async def _drain_writer(self, timeout: NumType = None) -> None:
        
        if self._stream_writer is None:
            raise SMTPServerDisconnected("Client not connected")

        # Wrapping drain in a task makes mypy happy
        drain_task = asyncio.Task(self._stream_writer.drain(), loop=self._loop)
        try:
            await asyncio.wait_for(drain_task, timeout, loop=self._loop)
        except ConnectionError as exc:
            raise SMTPServerDisconnected(str(exc))
        except asyncio.TimeoutError as exc:
            raise SMTPTimeoutError(str(exc))
923671
private void writeAccepted(long tick)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "writeAccepted",
        new Object[] { Long.valueOf(tick)});

    AIAcceptedTick at = writeAcceptedNoTimeout(tick);
    _initialAcceptedTOM.addTimeoutEntry(at);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "writeAccepted");
  }