Repository navigation
Conversation
mcculls
force-pushed
the
mcculls/context-capture-flag
branch
from
November 7, 2026 01:00
faf08bb to
281b4af
Compare
Contributor
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Expose capture controls on Context and ContextManager, bridging them to legacy async propagation flags. Disabled capture returns a no-op continuation; closing an attached scope restores its previous flag. Introduce ContextHandle for saved contexts and checkpoint() to preserve execution-unit flags without changing the active context. Swapping to a different context resets flags or restores those saved in a handle, and returns a checkpoint of the displaced context. Same-context swaps leave flags unchanged. Use checkpoint handles across coroutine, fiber, actor, poller, and virtual thread context switches. Checkpoint the initial ZIO fiber context after capturing its continuation, and inherit the enclosing flow's capture flag in Akka and Pekko HTTP handlers. Cover capture suppression, checkpoints, scope restoration, context swaps, cross-thread restoration, virtual threads, and custom context providers. Update context tracking guidance and benchmarks for the expanded API.
mcculls
force-pushed
the
mcculls/context-capture-flag
branch
from
November 7, 2026 22:25
281b4af to
6991387
Compare
Contributor
Author
|
Splitting into smaller PRs |
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.
What Does This Do
Add capture controls to the Context API and preserve execution-unit flags across context switches. Disabling capture returns a no-op continuation, while explicit attachment and swapping remain available. Checkpoint handles let coroutine and fiber integrations save context and flags without changing the active context or retaining a trace.
Motivation
Instrumentations need to suppress incidental asynchronous propagation and restore execution state when switching between logical tasks. The new context manager needs these controls as part of its API, with clear ownership of saved state and trace-retaining continuations.
Additional Notes
checkpoint()remains a pass-through. This PR does not redesign flag storage outside legacy scopes or require legacy behavior to match every edge of the new manager's contract. The API documentation describes the target behavior as the legacy manager is retired.