java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.tunnel.pool.BuildHandler.TimeoutReq
All Implemented Interfaces:
Job
Enclosing class:
BuildHandler

private class BuildHandler.TimeoutReqextends JobImpl
Job that times out one unanswered build request.
  • Field Details

    • _state

      private final BuildHandler.BuildMessageState _state
      The build message being timed out.
    • _req

      private final BuildRequestRecord _req
      The record of the request being timed out.
    • _nextPeer

      private final Hash _nextPeer
      The next hop that never answered.
    • _decremented

      private final AtomicBoolean _decremented
      Guard so the pending count drops only once.
    • _retriesLeft

      private final int _retriesLeft
      Retries still allowed for this request.
  • Constructor Details

    • TimeoutReq

      TimeoutReq(RouterContext ctx, BuildHandler.BuildMessageState state, BuildRequestRecord req, Hash nextPeer, AtomicBoolean decremented, int retriesLeft)
      Prepares to time out one build request.
      Parameters:
      ctx - the router doing the timing out
      state - the build message to time out
      req - the record of the request
      nextPeer - the next hop that never answered
      decremented - guard so the pending count drops once
      retriesLeft - retries still allowed
  • Method Details

    • getName

      public String getName()
      The name of this job.
      Returns:
      the job name used for logging and identification
    • runJob

      public void runJob()
      The next-hop lookup ran out of time. First re-check the local netdb — the RI may have landed just as the timeout fired, which turns the common race into a success. If it really is a local miss, retry the lookup once while the originator's budget still allows a full second attempt: the timeout is not evidence against the peer, and rejecting threw away builds a retry completes. Only when the budget is exhausted (or retries are used up) is the request rejected. The reject leaves the peer's profile untouched and any established connection kept: blaming healthy peers here degraded selection quality over time, and mayDisconnect() shed connections that later builds could have used.