Repository navigation
Fix channel close race and main_thread_only wedge after errors - #445
Open
RonnyPfannschmidt wants to merge 3 commits into
Open
RonnyPfannschmidt wants to merge 3 commits into
RonnyPfannschmidt wants to merge 3 commits into
Conversation
…ter errors Channel.close() sent CHANNEL_CLOSE before removing the id from the channel factory, so a peer could return from waitclose() and run its next remote_exec while the old id was still registered. On a single CPU test_channel_passing_over_channel hit this almost every run (#374). With main_thread_only, executetask() returned early on an exception and never set _executetask_complete, so every later remote_exec on that worker was rejected as concurrent. Set it in a finally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014GZsREmCGLBsihTm2x9zm3
The session group cached gateways by transport only, so e.g. main_thread_only-popen reused whichever popen gateway was created first, usually a thread worker, and main_thread_only was barely exercised. Include the execmodel in the gateway id, reuse the shared sproxy1 and proxy-transport gateways, and skip test_gateway_status_busy for main_thread_only, which rejects concurrent remote_exec by design. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014GZsREmCGLBsihTm2x9zm3
This branch has not been deployed
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.
Requested by Ronny · project thread
🤖 Written by Claude Opus 5.5 via Claude Code for the execnet maintainers; I prompted it, it did the work, I read it.
Fixes #374:
Channel.close()sent the close message before unregistering the channel id, so the peer could see the close while the id was still registered. On one CPU this madetest_channel_passing_over_channelfail almost every run. Thegwtest fixture also cached gateways by transport only, somain_thread_onlycases mostly ran on thread workers. Keying it by execmodel exposed a second bug: after a task raised, amain_thread_onlyworker rejected every laterremote_execas concurrent.Generated by Claude Code