Message307649
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. |
|
Date |
User |
Action |
Args |
2017-12-05 08:56:06 | frickenate | set | recipients:
+ frickenate |
2017-12-05 08:56:06 | frickenate | set | messageid: <1512464166.7.0.213398074469.issue32220@psf.upfronthosting.co.za> |
2017-12-05 08:56:06 | frickenate | link | issue32220 messages |
2017-12-05 08:56:06 | frickenate | create | |
|