Skip to content

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Oct 13, 2025

Related: #1833
Previous: #1850
Blocking: #1884

TODO

  • Add comments explaining tree structure (namely we only support a proper tree)
  • Cleanup naming in supervision.rs

Copy link

cloudflare-workers-and-pages bot commented Oct 14, 2025

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7db779d
Status: ✅  Deploy successful!
Preview URL: https://8dd427b6.monorepo-eu0.pages.dev
Branch Preview URL: https://children-cleanup.monorepo-eu0.pages.dev

View logs

@patrick-ogrady patrick-ogrady changed the title [runtime] Tree-Structured Context [runtime] Tree-Structured Context (Remove Detached) Oct 14, 2025
});
}

fn test_supervision_tree_sparse_clone_chain<R: Runner>(runner: R)
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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);
Copy link
Contributor Author

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)

Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 93.16770% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.22%. Comparing base (27333b9) to head (7db779d).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
runtime/src/lib.rs 89.47% 18 Missing ⚠️
runtime/src/utils/supervision.rs 94.20% 4 Missing ⚠️
@@            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     
Files with missing lines Coverage Δ
runtime/src/deterministic.rs 96.30% <100.00%> (+0.57%) ⬆️
runtime/src/telemetry/metrics/task.rs 100.00% <100.00%> (ø)
runtime/src/tokio/runtime.rs 83.50% <100.00%> (+1.56%) ⬆️
runtime/src/utils/cell.rs 69.42% <ø> (+3.27%) ⬆️
runtime/src/utils/handle.rs 93.08% <100.00%> (+0.23%) ⬆️
runtime/src/utils/mod.rs 89.13% <100.00%> (+0.14%) ⬆️
runtime/src/utils/supervision.rs 94.20% <94.20%> (ø)
runtime/src/lib.rs 96.24% <89.47%> (-0.94%) ⬇️

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27333b9...7db779d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant