GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-161668: Refuse multiprocessing messages too large for a Windows pipe by dennev · Pull Request #161685 · python/cpython

Conversation

@dennev

@dennev dennev commented Nov 9, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Windows refuses a single pipe write of more than 0xFFFFFFCF bytes, but may already have completed a read that the other end was waiting on, with ERROR_MORE_DATA and nothing left in the pipe; that reader then fails at assert left > 0 in PipeConnection._get_more_data(). As discussed in #161668, this checks the size in PipeConnection._send_bytes() before anything is written and raises ValueError, the exception the documentation of send() and send_bytes() names. Supporting larger messages needs a header that stays compatible between Python versions and is left for later. The check uses the measured limit; a round margin such as 0xFFFF0000 would be a one-line change.

test_send_bytes_too_large lowers the limit and runs without -M; test_send_bytes_too_large_for_windows is a bigmemtest (-M 4G; it holds one 4 GiB buffer at a time) with the real sizes. Both give a receiver thread 0.1 s to block in recv_bytes() before the oversized send, then check that it gets the next message; the first also sends a message of exactly the limit. Without the change the first fails with "ValueError not raised" and the second with OSError: [WinError 87]. I also checked on a debug build that a message of exactly 0xFFFFFFCF bytes still arrives whole, and that a Pool worker survives a task that is too large and runs the next one.

  • Issue: multiprocessing: on Windows, a message over 4,294,967,247 bytes raises OSError and breaks a waiting receiver #161668

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dennev @claude
pythongh-161668: Refuse multiprocessing messages too large for a Wind…
1fb843a
…ows pipe

Windows refuses a single pipe write of more than 0xFFFFFFCF bytes with
ERROR_INVALID_PARAMETER, but may already have completed a read that the
other end was waiting on, with ERROR_MORE_DATA and nothing left in the
pipe.  The reader then fails at "assert left > 0" in
PipeConnection._get_more_data(), which kills a Pool worker.  Check the
size in PipeConnection._send_bytes() and raise ValueError, as the
documentation of send() and send_bytes() describes, before anything is
written, so both ends stay usable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dennev
dennev requested a review from gpshead as a code owner November 9, 2026 16:22
@python-cla-bot

python-cla-bot Bot commented Nov 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot mentioned this pull request Nov 9, 2026
multiprocessing: on Windows, a message over 4,294,967,247 bytes raises OSError and breaks a waiting receiver #161668
Open
@bedevere-app bedevere-app Bot added the awaiting review label Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead Awaiting requested review from gpshead gpshead is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dennev
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.