-
Notifications
You must be signed in to change notification settings - Fork 87
Split mux's Tracer type #5112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
coot
wants to merge
32
commits into
mwojtowicz/inbound-governor-turbo
Choose a base branch
from
coot/inbound-governor-turbo
base: mwojtowicz/inbound-governor-turbo
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Split mux's Tracer type #5112
coot
wants to merge
32
commits into
mwojtowicz/inbound-governor-turbo
from
coot/inbound-governor-turbo
Conversation
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
Contributor
coot
commented
Apr 18, 2025
- network-mux: removed handshake traces
- network-mux: split mux tracer into three independent parts
Profiling exposed that firstPeerTo* are CPU intensive in the amount of state checking performed for all active connections. Especially the LastToFinish actions are expensive. However, much of this work can be short-circuited. Addition of this tracer allows responding to events in the order they arrive for just the pertinent connection/peer, avoid repetitive state checking. This tracer uses the information channel plumbed from the top level, and in turn it itself is passed to the muxer by the connection handler via the connection manager. The tracer is joined with the mux tracer in the inbound handler, and outbound handler strictly when a duplex connection is negotiated for the latter. In effect, the muxer has a direct write-only communication channel to the inbound governor where only a few of the events need to be monitored such that the IG can properly manage its transitions. Add IG tracer responder counters Change RemoteIdle tag The change is motivated by the need of the new tracer to ensure proper sequencing of events on the queue. In case a connection is expired and responder startup is demanded, the tracer will retry until the connection is RemoteCold to register the promotion, or abort when the connection is dropped (CM CommitTr returned).
Added responder counters state variable managed by the new tracer Instantiate the connection handler with the tracer and run the connection manager continuation with it. The IG tracer is plumbed in the end to mux.
Moved 'InboundGovernorInfoChannel` to InboundGovernor
Previously, the queue was only used to communicate new connections to the inbound governor. The queue is now used to also notify the IG of muxer events so it will be busier.
Process all the info channel events from the queue in one step of the IG loop. The queue events arrive from the CM (new connection) or from the tracer which tracks miniprotocol responder activity and mux start/stop.
Also reflects changes to 'RemoteIdle' tag
Most of the functionality of the Event is unneeded anymore and the module is removed, with its still useful remnant moved here. Updates reflecting changes to 'RemoteIdle' tag were applied.
The IG now applies the withConnectionManager continuation from the top level Diffusion module to pass it the info channel tracer. Changes in this module reflect the sequencing changes applied to the latter module.
Since the IG creates the connection handler by passing it the new tracer, this argument was moved to the back of the list. The prior arguments are created at the top level, where various types are instantiated. This reflects the sequencing of applications needed to create the CM.
Some comments, and reordering/addition of tracing which reflects functional perspective of how the IG processes responder events and mux start/stop events. Fix termination bug The inbound governor information channel can reach its limit when the server is shutting down and the IG loop stops draining it. The mux async exception handler writes to the queue when each connection is being torn down by the CM, which then awaits for each handler to complete.
Contains mux tracer and separate channel tracer. The idea is that the channel tracer should not contain the inbound governor's information channel tracer which may be present in the muxTracer field for certain connections. The protocol channel send/receive trace tags are uniteresting from the IG tracer's perspective but there is a penalty for invoking it so frequently for every complete message.
The tracer is attached to the inbound handler and to the outbound handler only when a duplex mode was negotiated.
The bug was exposed when Mux.run signature was changed to accept the new MuxTracerBundle type instead of the Mux.Trace's Trace type. The latter Trace type mixes low level bearer tags with the higher level mux tags, so logically they are separate and in fact are traced by separate components. The headerTracer must go along with the bearer tracer otherwise it doesn't trace anything, but the types matched so the program was accepted.
The Server is started once the IG instantiates the CM with its tracer.
No other significant changes besides cosmetics.
This addresses the shrinker hang when attempting to shrink 'AbsBearerInfo' in some cases.
This change fixes a termination bug in command shrinking and improves the quality of shrinker results for the 'DiffusionScript'. The overall perfomance should also improve with better pruning of nodes and the commands which direct their execution. o-n-framework shrinker improvement
This annotes each trace with a nice (node-x), where x is a number [1..max-node in simulation]. This facilitates grepping a trace for just the node that failed a test. In the mkTracers binding, one can either turn on all component tracers for general testing, and in case of failure of a test where only a subset of components are really needed, one can selectively toggle just the interesting sayTracers to further cut down the noise.
Comprehensibility improvements
The `BearerTracer` has an extra event: `EmitDeltaQ`. The tracers are now conveniently passed to `Mx.run` function from where they are available to a channel & a bearer.
b016212
to
1cbdaa2
Compare
0f9e65c
to
025e2d0
Compare
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.