-
Notifications
You must be signed in to change notification settings - Fork 111
[runtime] Tree-Structured Context (Remove Detached
)
#1867
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
base: main
Are you sure you want to change the base?
Conversation
Deploying monorepo with
|
Latest commit: |
7db779d
|
Status: | ✅ Deploy successful! |
Preview URL: | https://8dd427b6.monorepo-eu0.pages.dev |
Branch Preview URL: | https://children-cleanup.monorepo-eu0.pages.dev |
Detached
)
}); | ||
} | ||
|
||
fn test_supervision_tree_sparse_clone_chain<R: Runner>(runner: R) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove supervision
from the test names
/// Metric label describing whether a task runs on a dedicated thread. | ||
#[derive(Clone, Debug, Hash, PartialEq, Eq, EncodeLabelValue)] | ||
pub enum Mode { | ||
pub enum Execution { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: improve the naming here
/// registers a new child node beneath the current node, while spawning a task transfers ownership | ||
/// of that node to the spawned task. When a context finishes or is aborted, the runtime drains the | ||
/// node and aborts all descendant tasks. | ||
pub(crate) struct SupervisionTree { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: improve the naming here
|
||
fn register_child(&mut self, child: &Arc<SupervisionTree>) { | ||
// To avoid unbounded growth of children for clone-heavy loops, we reap dropped children here. | ||
self.children.retain(|weak| weak.strong_count() > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This avoid the child ever needing to interact with the parent (which may cause a deadlock from mutex cycle)
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1867 +/- ##
==========================================
+ Coverage 92.10% 92.22% +0.11%
==========================================
Files 307 309 +2
Lines 79643 81447 +1804
==========================================
+ Hits 73357 75115 +1758
- Misses 6286 6332 +46
... and 11 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Related: #1833
Previous: #1850
Blocking: #1884
TODO
supervision.rs