fix: stop polling transports when the magicsock is closing#3615
Merged
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3615/docs/iroh/ Last updated: 2025-11-06T11:53:22Z |
flub
approved these changes
Nov 6, 2025
Contributor
flub
left a comment
There was a problem hiding this comment.
A separate question is why MagicSock has both is_closing and is_closed. But this makes sense, thanks!
Member
Author
Yeah, I was tempted to clean up the closing variables a bit further, but will leave that to a separate PR. |
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.
Description
Since we merged #3601 we sometimes get ugly (but harmless) error log messages when the endpoint is shutting down:
This fixes it: We already have a check in the transports to return
Pendingwithout polling the actual transports onceMagicsock::is_closedistrue. This PR changes it to instead checkMagicsock::is_closing. The latter is set afterEndpoint::wait_idlecompleted, but before cancelling the actor and transport tasks. Whereasis_closedis set after the actor and transport tasks are fully shutdown. WhenEndpoint::wait_idlecompletes, we do not expect the quinn endpoint to do anything meaningful, so it is fine to stop polling the transports at this time, and thus not get errors from the transports into quinn if they fail (because they are shutting down).Breaking Changes
Notes & open questions
Change checklist
quic-rpciroh-gossipiroh-blobsdumbpipesendme