Skip to content

fix(arty): avoid blocking worker startup during TLS teardown - #1036

Draft
martin-kolinek wants to merge 1 commit into
mainfrom
ox-loop/8263513
Draft

martin-kolinek wants to merge 1 commit into
mainfrom
ox-loop/8263513

Conversation

@martin-kolinek

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 4653dd5a0da0de9226f31960b36743068fb4df16

Dimension Assessment Rationale
Change confidence 9/10 ↑ Fixture-only diff; both release tests pass with CI's compiler; repository pre-commit checks pass.
↑ Equivalent isolated fixture passed 3,000 repetitions and retained destroyed-slot sensitivity.
↓ Official Windows release validation awaits merge.
Diagnosis confidence 9/10 ↑ Same-source, same-compiler reproduction and startup probes identify a worker-startup wait during Windows TLS destruction; the fix removes that dependency.
↓ No stack dump from the original CI hang is available.
Evidence fit 8.5/10 ↑ Reproduction exercises the exact stalled test with the reported release compiler.
↓ Windows Server/provider concurrency has not yet been observed with this fix.

🤖 Fixes Bug 8263513.

Problem

Build 20261127.3 stalled in Arty's existing worker-slot teardown regression. Its TLS destructor could wait for a native blocking worker to start while Windows held the loader lock that startup needs.

Changes

Wait for the fixture's existing second task before the external thread exits. The existing single-worker FIFO pool publishes the retained first result before that barrier completes. During TLS destruction, poll the retained join once with now_or_never and require its successful result instead of entering a blocking executor.

This changes only the test fixture. It still polls after the worker TLS slot is destroyed and verifies 42, preserving PR 896's original regression. Production runtime behavior is unchanged.

Validation

Local: both existing tests passed in release mode using CI's 1.97.1-ms-20261116.4 LLVM compiler:

cargo +ms-prod-1.97@llvm test --locked --offline --release -p arty --all-features --test blocking_wait_cycles -- --nocapture

just anvil-clippy, just anvil-fmt --fix, just anvil-readme --fix, and just anvil-spellcheck passed. Equivalent isolated design evidence covers 3,000 successful teardown repetitions and an intentional CURRENT.with negative control that fails with destroyed-slot AccessError; no repetition helper or runtime mutation is included.

PR checks cover broader platforms and quality. After merge, the existing main-branch publishing pipeline must show successful Windows release testing and advance beyond it; that provider result is not yet available.

Complete the existing FIFO barrier before the external thread exits, then poll the retained ready join once during TLS destruction. Preserve destroyed-slot lookup coverage without waiting under the Windows loader lock.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (9e73397) to head (4653dd5).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##            main    #1036      +/-   ##
=========================================
  Coverage   99.9%   100.0%              
=========================================
  Files        854      130     -724     
  Lines      75041     8382   -66659     
=========================================
- Hits       75032     8382   -66650     
+ Misses         9        0       -9     
Flag Coverage Δ
linux 100.0% <ø> (ø)
linux-arm 100.0% <ø> (ø)
scheduled ?
windows 100.0% <ø> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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