Sitelet https://github.com/python/cpython/issues/96819
Skip to content

Multiprocessing resource tracker incorrectly checks pipe write length #96819

Description

@grgsrs

I think this line should be:

if len(msg) > 512:

Activity

  1. saito828koki commented on Sep 17, 2022

    @saito828koki
    Contributor

    @grgsrs
    Thanks for your report!

    Your suggestion seems to be correct. To guarantee that a write operation is atomic, the length of msg has to be less than or equal to PIPE_BUF(the kernel pipe buffer size).
    According to this page, the minimum acceptable value of PIPE_BUF is set to 512 bytes in POSIX system , so checking if len(msg) is not greater than 512 is enough.

    I will create a PR for this issue.

  2. grgsrs commented on Sep 17, 2022

    @grgsrs
    Author
  3. added a commit that references this issue on Oct 3, 2022
  4. added 4 commits that reference this issue on Oct 3, 2022
  5. added a commit that references this issue on Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions