This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author frickenate
Recipients frickenate
Date 2017-12-05.08:56:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512464166.7.0.213398074469.issue32220@psf.upfronthosting.co.za>
In-reply-to
Content
In multiprocessing/reduction.py, there is a hack workaround in the sendfds() and recvfds() methods for darwin, as determined by the "ACKNOWLEDGE" constant. There is a reference to issue #14669 in the code related to why this was added in the first place. This bug exists in both 3.6.3 and the latest 3.7.0a2.

When a file descriptor is received, this workaround/hack sends an acknowledgement message to the sender. The problem is that this completely breaks Duplex pipes depending on the timing of the acknowledgement messages, as your "sock.send(b'A')" and "sock.recv(1) != b'A'" calls are being interwoven with my own messages.

Specifically, I have a parent process with child processes. I send socket file descriptors from the parent to the children, and am also duplexing messages from the child processes to the parent. If I am in the process of sending/receiving a message around the same time as your workaround is performing this acknowledge step, then your workaround corrupts the pipe. 

In a multi-process program, each end of a pipe must only be read or written to by a single process, but this workaround breaks this requirement. A different workaround must be found for the original bug that prompted this "acknowledge" step to be added, because library code must not be interfering with the duplex pipe.
History
Date User Action Args
2017-12-05 08:56:06frickenatesetrecipients: + frickenate
2017-12-05 08:56:06frickenatesetmessageid: <1512464166.7.0.213398074469.issue32220@psf.upfronthosting.co.za>
2017-12-05 08:56:06frickenatelinkissue32220 messages
2017-12-05 08:56:06frickenatecreate