fix slow subscriber bug in zmq runner - #251
Merged
Merged
Conversation
Merging this PR will degrade performance by 17.38%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| 👁 | Simulation | test_long_add[ZMQRunner-testing-long-add] |
2.2 ms | 2.6 ms | -17.38% |
Comparing fix-zmq-pub-race (e7a72a6) with main (6a6c5d4)
Footnotes
-
8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
…eadyDone on the double-asset-done path
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.
I think this should actually fix the sporadically failing tests once and for all...
previously we had fixed a hung thread/quitting error on the command node that was causing problems, but that unmasked another source of sporadic error.
Basically the issue is that we were signaling that every node was "ready" once it had initiated the subscription to its upstream nodes, and most of the time this was fine.
However there was a race condition where the subscription was initiated but not completed on the publisher side, which caused the upstream node to run and emit events that were never received by the downstream nodes.
to fix this, change publisher sockets to XPUB which allows polling for subscription events, and then subscribe to some empty topic like
__subscription__:{node_id}. The publishers can then learn who is subscribed to them and re-announce their identification, which now includes the list of the nodes that are subscribed to them, so that subscribers can know when they have been successfully subscribed. only then do we mark a node as being "ready".this makes for a decent amount of chatter on startup, but that's an optimization to be done after we have gotten the behavior rock solid.
I also went and did the pdm workspaces swap, since the CI time expanded with noob core and it became worth it to use gh actions caches for the deps, where it wasn't before
📚 Documentation preview 📚: https://noob--251.org.readthedocs.build/en/251/