Repository navigation
Conversation
Session.destroy called congestion.recv() before req.destroy(), which has also called it since ba369da. Each destroyed session request was credited twice, so the window under-counted what is in flight.
Contributor
Author
|
Hi, friendly ping on this. It still merges cleanly. Let me know if you'd like any changes. |
Contributor
|
nice catch |
JayOfTheKeyboard
added a commit
to JayOfTheKeyboard/JayOfTheKeyboard
that referenced
this pull request
Oct 27, 2026
Contributor
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Session.destroycredits the congestion window twice for each request it destroys.#78 added
this.dht.io.congestion.recv()toSession.destroyso that unanswered session requests stop counting as congestion. Since ba369da,Request.destroycallsthis._io.congestion.recv()itself, so the session path now does it twice. The window then under-counts what is in flight. With three session requests and one unrelated request in flight in the same slot, destroying the session leaves_totalat 0 while the other request is still outstanding, so each destroyed session request can let one extra request out beforeisFull()trips.This removes the call from
Session.destroy, leavingRequest.destroyas the one place a destroyed request is released.The new test sends one request and three session requests to a node that never replies, destroys the session, and checks the window still counts the remaining request. On main it fails with
actual: 0, expected: 1, and it passes with the change (20 of 20 runs).npm run lintis unchanged (same 10 warnings as main), andnpm run test:nodeandnpm run test:bare(Bare 1.34.1) pass, 53/53.