Repository navigation
Wake the daemon poller with mio::Waker - #527
Merged
Merged
Conversation
Loopback UDP was only used to interrupt poll after a command was queued. One shared Waker removes that socket, and the flume queue remains the source of truth when wakeups coalesce.
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.
Each command used to bind a loopback UDP socket and send a datagram whose only job was to interrupt
mio::Poll. That depended on ephemeral ports and the local UDP stack, and a failed send could report an error after the command was already queued.One
Arc<mio::Waker>is created from the daemonPollbefore the thread starts and shared by every cloned handle. The daemon thread keeps its own clone, so dropping a handle does not deregister the waker. mio allows a singleWakerperPoll.wakeruns only after a successfultry_send. A full channel is stillError::Againand a disconnected channel is stillError::DaemonShutdown, with no wake. Ifwakeitself fails, the error is returned and the command stays queued: the error does not mean the command was rejected, and there is no rollback.Wakeups are not command counts. mio may coalesce many
wakecalls into one event, and a wake issued before the firstpollstays pending. After everypollthe loop drains the flume receiver until it is empty, so a coalesced notification cannot drop a queued command.