Skip to content

Test Windows signal wakeup socket error reporting - #9023

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:audit/windows-wakeup-reporting
Oct 12, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:audit/windows-wakeup-reporting

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Current revision

Targets Python 3.15 main at f39da82d9d38cd5bdceb9e645205e830f65126fb with one logical commit, 44712eb1979fdc1934b43a2e07e9d2f7909ac286. The unique patch is unchanged from the prior reviewed PR head (range-diff =); current main fixes, original author attribution, and assistance trailers are preserved. No files under Lib/ are changed.

Normal commit hooks, changed-range hooks, whitespace checks, and source-equivalence review passed. Normal hosted CI is enabled for this exact head. No new native build or runtime validation is claimed; earlier results below remain attributed to their original revisions.

Summary

Extract Windows signal wakeup-socket error reporting from #8954, with a regression in the existing stdlib_signal.py snippet.

  • Capture Winsock send failures without allocating or locking in the OS signal handler, using bounded atomic storage.
  • Report failures through sys.unraisablehook on the main interpreter thread before Python signal handlers run.
  • Honor warn_on_full_buffer=False for WSAEWOULDBLOCK only; other socket errors remain reported.
  • Leave Unix/WASI notification and Windows CRT wakeup writes unchanged.

The regression uses bounded numeric-loopback TCP sockets and covers successful byte delivery, default/true/false/default full-buffer reporting, unraisable-hook fields, and invalid-socket errors with warnings disabled. Signal handlers are reinstalled for each raise.

Reference: CPython v3.14.7 signalmodule.c.

Validation

  • Regression-first hosted Windows run: CPython 3.14.7 passed; RustPython failed the intended missing-unraisable assertion.
  • Fixed hosted Windows run, head f216ec98bee1b5ac8540bda27f98988fb098f13a: CPython and RustPython signal snippets passed. Full snippets: 480 passed, 4 skipped. Canonical tests: SUCCESS, 43,883 run, 4,927 skipped.
  • Hosted Linux/macOS snippet and canonical jobs, platform Clippy jobs, lint, and target compile checks passed. Normal commit hooks passed.
  • CI is not all green: Windows Rust tests exceeded the 45-minute limit and were cancelled while four existing subinterpreter/stop-the-world tests remained running. Whether that timeout is related to this change has not been established. The job could not be restarted through the attempted job-rerun command.
  • No local patched runtime build or complete local aggregate runtime suite is claimed; native Windows validation above comes from hosted CI.

AI assistance

OpenAI Codex assisted with source comparison, regression design, independent review, and validation. The runtime did not expose its model identifier.

@coderabbitai

coderabbitai Bot commented Oct 9, 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: f87624f5-3beb-40c6-b4af-75781304fc72

📥 Commits

Reviewing files that changed from the base of the PR and between f39da82 and 44712eb.


📒 Files selected for processing (4)
  • crates/host_env/src/signal.rs
  • crates/vm/src/signal.rs
  • crates/vm/src/stdlib/_signal.rs
  • extra_tests/snippets/stdlib_signal.py

 __________________________________
< Jazz Jackrabbit is my alter ego. >
 ----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ 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
youknowdot force-pushed the audit/windows-wakeup-reporting branch 2 times, most recently from cc1a2da to 4a16d45 Compare October 11, 2026 03:21
@youknowone
youknowone changed the base branch from main to stack/python-3.15-8950 October 11, 2026 03:24
@youknowdot
youknowdot force-pushed the audit/windows-wakeup-reporting branch from 4a16d45 to 4bb1f97 Compare October 11, 2026 04:07
@youknowone
youknowone changed the base branch from stack/python-3.15-8950 to main October 11, 2026 04:07
@youknowdot
youknowdot force-pushed the audit/windows-wakeup-reporting branch from 4bb1f97 to a035e0f Compare October 11, 2026 04:14
@github-actions

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

[ ] test: cpython/Lib/test/test_mmap.py (TODO: 19)

dependencies:

dependent tests: (2 tests)

  • mmap: test_os
    • multiprocessing.shared_memory: test_genericalias

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

Capture Winsock failures with bounded atomic storage and report them through sys.unraisablehook on the interpreter thread. Honor warn_on_full_buffer for WSAEWOULDBLOCK. Include bounded Windows socket regressions without changing Unix or CRT wakeup writes.

Assisted-by: OpenAI Codex:model identifier unavailable
@youknowdot
youknowdot force-pushed the audit/windows-wakeup-reporting branch from a035e0f to 44712eb Compare October 11, 2026 19:44
@youknowone
youknowone marked this pull request as ready for review October 12, 2026 13:27
@youknowone
youknowone merged commit 129330f into RustPython:main Oct 12, 2026
29 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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-12T13:35:14.286015Z 44712eb 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44712eb197

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

signal.signal(signal.SIGUSR2, signal.SIG_DFL)


def check_windows_wakeup_reporting():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the disallowed test-logic addition

This adds a new test function with many assertions to a test file, but the repository's critical test policy forbids modifying test assertions, logic, or data and limits acceptable test-file edits to expected-failure decorator changes. Drop this test-file addition or obtain an explicit policy exception before landing the runtime change.

AGENTS.md reference: AGENTS.md:L273-L279

Useful? React with 👍 / 👎.

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