Skip to content

Detach Windows multiprocessing socket I/O during blocking calls - #9093

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix/windows-multiprocessing-socket-detach
Oct 13, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix/windows-multiprocessing-socket-detach

Conversation

@youknowone

Copy link
Copy Markdown
Member

Summary

Detach the VM thread around blocking Windows _multiprocessing.recv and _multiprocessing.send, following the existing socket I/O convention. These calls currently remain attached while waiting in Winsock, which can prevent stop-the-world collection from completing.

  • Obtain an unlocked send buffer before detaching, so mutable-buffer locks are not held across the wait.
  • Keep the buffer owner alive through reattachment.
  • Convert the host-captured io::Error after reattachment instead of querying the thread's last error again.

This is a shared-main fix found while investigating #9088. The captured Windows stack stops in proxy finalization while waiting for a new manager authentication response. Missing detachment is a source-confirmed hazard consistent with that symptom; the capture does not establish the server's GC state or prove this is the exact cause of that hang.

Validation

  • Independent ownership/source review and normal commit hooks passed.
  • Linux stdlib threading compile-only check and strict Clippy passed (jobs1). These checks do not compile the Windows-conditional function bodies.
  • Windows-specific compilation and existing canonical runtime coverage: pending hosted CI.
  • No new remote-manager reproduction or concurrency/crash probe was run locally.

One production file; no Lib changes, skips, timeout changes, or test assertion changes.

Snapshot locked send buffers before waiting and preserve the host-captured Winsock error across VM reattachment.

Assisted-by: OpenAI Codex: model identifier unavailable
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e256b6a5-0d62-42e1-9e01-b8329f0dafef
📥 Commits

Reviewing files that changed from the base of the PR and between e09846b and a26d161.

📒 Files selected for processing (1)
  • crates/stdlib/src/multiprocessing.rs
 ________________________________________________
< If this were a race, you'd still be importing. >
 ------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

youknowdot added a commit to youknowdot/RustPython that referenced this pull request Oct 13, 2026
Keep the compiler-only diff unchanged while incorporating the exact source-reviewed RustPython#9093 repair.

Assisted-by: OpenAI Codex: model identifier unavailable
@youknowone
youknowone marked this pull request as ready for review October 13, 2026 11:47
@youknowone
youknowone merged commit 10cb494 into RustPython:main Oct 13, 2026
30 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T11:49:58.773159Z a26d161 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

2 participants