Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 880eca8d4a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| withTimeout(timeoutMs) { | ||
| connection.write(PeerWire.encode(PeerHashWire.encode(PeerHashMessage.Request(selector)))) | ||
| } |
There was a problem hiding this comment.
Align write timeout with the exchange deadline
With the defaults, exchange.request(selector) starts a 30-second response deadline before this block, while the write may remain suspended for up to the transport's 180-second timeout. If socket backpressure delays a successful write beyond 30 seconds, request() returns a ticket that is already expired, so even an immediate valid response is rejected by PeerHashExchange.receive; because request and expiry are actor-owned, the blocked write also prevents that actor from expiring the ticket meanwhile. Bound the write by the exchange deadline or verify/cancel the ticket before returning it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in bd9c0a8. Request writes now use the lesser of the transport timeout and the exact exchange ticket's remaining deadline, and recheck that deadline before returning. Failure closes the stream and releases request/frame credit. The regression failed on the previous code by returning an expired ticket; it now covers both suspended backpressure and a write that finishes at the deadline without suspending. All nine focused transport/exchange tests and iOS test-source compilation pass.
|
Superseded by #235 (V2 handshake, hash exchange and bounded transport) in the consolidated eight-PR stack for #162. The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks. Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment) |
Connects hash-request ownership to frame issuance, bounded body reads and actor response dispatch on an already negotiated v2 connection. Body/decode credit is reserved before reading the payload and retained through dispatch; authenticated results keep separate exchange credit. Failed or canceled writes close potentially partial streams, and failed/timed-out/unadmitted reads close the connection and release frame credit.
Stacked on #188; advances step 08 of #162. One actor owns request/accept/expiry/close and joins its separately serialized reader after closing. Handshake routing, the complete runtime actor, timers, reply serving and payload integration remain pending. The inherited 64 KiB generic frame ceiling also needs profile-aware replacement for one-million-piece desktop bitfields; the production target is unchanged.
Validation: all four focused JVM transport tests pass, including loopback TCP request/response authentication, control-message dispatch, body admission before read, write failure and timeout cleanup. All 390 iOS simulator torrent tests executed and passed with zero failures/errors/skips using
-PenableIosSimulatorTests=true. This framing test does not establish v2 handshake or independent-client interoperability.