chore: (For Discussion) Dynamic runtime detection & block_on abstraction#3412
Draft
scottgerring wants to merge 3 commits intoopen-telemetry:mainfrom
Draft
chore: (For Discussion) Dynamic runtime detection & block_on abstraction#3412scottgerring wants to merge 3 commits intoopen-telemetry:mainfrom
scottgerring wants to merge 3 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3412 +/- ##
=====================================
Coverage 83.1% 83.2%
=====================================
Files 128 128
Lines 24899 24921 +22
=====================================
+ Hits 20715 20743 +28
+ Misses 4184 4178 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Fixes #2643, stabilising
Runtimetrait. Note that i've not removed the experimental flags, but will do so when we're happy with an approach. Note that i've not removed the experimental flags, but will do so when we're happy with an approach.This is a light touch approach to stabilising the runtime trait.
We do this by consolidating
TokioandTokioCurrentThreadinto a singleTokioruntime type that auto-detects the active Tokio runtime flavour at call time usingHandle::try_current()andruntime_flavor():tokio::spawnThis eliminates the
rt-tokio-current-threadfeature flag entirely — users just enablert-tokioand the right behavior happens automatically.Additionally adds a
block_onmethod to theRuntimetrait, which is also runtime-flavour-aware: on current-thread it usesstd::thread::scopeto block on a separate thread, avoiding deadlocks. This replaces ad-hocfutures_executor::block_oncalls scattered through processors.this aims to be a minimal, focused change - keeps the existing
oneshot-based shutdown signalling.