• Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Networking, Performance
    • None
    • Networking & Observability
    • ALL
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      AsioNetworkingBaton::markKillOnClientDisconnect() adds the client's session to the baton's poll set right away (POLLRDHUP), and detachImpl() cancels that registration when the operation ends. A disconnect can only be noticed while the baton polls, and most operations never wait on their baton, so for them the add-and-cancel (allocations, locking, future continuations) is overhead on every operation.

      markKillOnClientDisconnect() now records the disconnect error code; run() adds the session to the poll set before the baton polls for the first time, and detachImpl() clears the recorded state. Operations that wait are still killed when their client disconnects.

      Measured effect

      • YCSB workload B (95% read, 5% update): instructions/op -1.8%

      YCSB, single-node replica set, 5M documents in the WiredTiger cache; cycles and instructions per operation.

      Risk

      The registration is deferred, not removed; it always happens before the first poll.

      Tests

      Adds baton tests in asio_transport_layer_test.cpp for a disconnect after the baton has polled, a disconnect while the baton polls, marking twice, and an operation that never polls (not killed, and the next operation of the client is not affected).

            Assignee:
            Unassigned
            Reporter:
            Igor J Konopko (EXT)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: