Repository navigation
Schedule traced callbacks eagerly with scoped shutdown writes - #135
Closed
Stephen Belanger (Qard) wants to merge 1 commit into
Closed
Stephen Belanger (Qard) wants to merge 1 commit into
Stephen Belanger (Qard) wants to merge 1 commit into
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
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.
Experiment::tracedpreviously started only when polled and ran its callback on the awaiting task. It now admits one owned callback immediately and returns a completion token; dropping that observer leaves accepted work running on the selected execution binding. Callback inputs, futures and results requireSend + 'static.Accepted callbacks receive a bounded, private write scope so their root and child spans can finish dependent writes after shutdown closes ordinary admission. Callbacks run outside queue preparation, allowing nested awaited writes to make progress. Completion, panic, runtime loss and deadline cancellation revoke the scope even when span handles escape.
SpanHandle::child_builderpreserves the parent context and scoped submission while keeping child finish state independent.Shutdown waits for these scopes and their dependent writes. Ordinary flushes retain fixed cutoffs, and terminal batch failures still retire without replay or poisoning subsequent flushes. Scope admission shares the existing delivery capacity controls; it adds no public cancellation API.
Validation:
cargo test --all-featurespassed 352 unit/integration tests and 9 doctests (existing 1 integration test and 4 doctests remain ignored). Strict all-target/all-feature Clippy, rustdoc, formatting and diff checks passed. Nine new tests cover shutdown before first poll, nested writes, escaped handles, observer drop from a plain thread, bounded admission, callback panic, runtime loss, deadline cancellation and terminal failure retirement.Stacked on #134. The standalone direct API completion facade and evaluator decomposition remain subsequent layers. Planning documents are excluded.