Repository navigation
Multiprocessing resource tracker incorrectly checks pipe write length #96819
Copy link
Copy link
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errorstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Sep 14, 2022 @grgsrs
Thanks for your report!Your suggestion seems to be correct. To guarantee that a write operation is atomic, the length of
msghas to be less than or equal toPIPE_BUF(the kernel pipe buffer size).
According to this page, the minimum acceptable value ofPIPE_BUFis set to 512 bytes in POSIX system , so checking iflen(msg)is not greater than 512 is enough.I will create a PR for this issue.
- Thanks for responding so quickly and glad to help (if only in a very small way).…On Sat, 17 Sep 2022 at 7:11 pm, Koki Saito ***@***.***> wrote: @grgsrs <https://github.com/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 <https://man7.org/linux/man-pages/man7/pipe.7.html>, 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. — Reply to this email directly, view it on GitHub <#96819 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAN26F3OTN34Z2FUYN3NP4DV6WDN5ANCNFSM6AAAAAAQMEMOBM> . You are receiving this because you were mentioned.Message ID: ***@***.***>
- added a commit that references this issue
on Oct 3, 2022 - added 4 commits that reference this issue
on Oct 3, 2022 - added a commit that references this issue
on Oct 3, 2022
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
cpython/Lib/multiprocessing/resource_tracker.py
Line 164 in 4781535
I think this line should be: