Repository navigation
fix: stop compute log capture deadlocking a command at exit - #1165
Merged
Merged
Conversation
…hed capture A write that reached a capture already marked complete built its rejection while still holding the storage lock. Building it imports Python, which can release the GIL; the main thread then pruning the logs waited for that lock while holding the GIL, so neither could continue and the command never exited. The lock is now released before the rejection is raised.
…alling the job run_sqb now gives each command ten minutes. A command still running then has its process group aborted with Python's fault handler enabled, so the failing test reports every thread's stack, and the group is killed. Standard input ends at once when a test passes none.
kvlonge
enabled auto-merge (squash)
October 19, 2026 21:01
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.
Why
The DuckDB E2E (CLI commands) job hung until its 45-minute limit in two runs. Both times the
compile in the audit meta test that must fail on a non-JSON factory meta value never exited; one
or two other commands in the same runs also never finished.
A stack dump from a local reproduction (about 1 in 5,000 runs under load) showed a deadlock in
compute log capture. A late log record from a background thread was written to a capture already
marked complete. The storage built the rejection while still holding its lock, and building it
imports Python, which can release the GIL. The main thread, pruning the logs, then waited for the
lock while holding the GIL, so neither thread could continue.
Changes
capture, and documents that no Python may run while the lock is held.
exceptions while the main thread prunes). Without the fix it deadlocks every time.
run_sqbin the E2E helpers gives each command ten minutes. A command still running then has itsprocess group sent SIGABRT with
PYTHONFAULTHANDLERset, so the failing test shows everyPython thread's stack and the job continues. Standard input ends at once when a test passes
none, which matches the
/dev/nullstdin xdist workers already have. Tests for the helper jointhe CLI shard.
Verification
meta, upstream function and janitor E2E files, and the shared helper tests.
make check-civia the verify hook, ruff, ty, fensu and the public hygiene scan.