[New-bugs-announce] [issue29158] Possible glitch in the interaction of a thread and a multiprocessing manager

Luciano Dionisio report at bugs.python.org
Wed Jan 4 14:19:03 EST 2017


New submission from Luciano Dionisio:

After spending a lot of time trying to understand why my code will not execute as expected and after not getting any help from StackOverflow:

http://stackoverflow.com/questions/41444081/python-multiprocessing-manager-delegate-client-connection-and-dont-wait

I assumed that it may be a possible glitch in the interaction of a thread and a multiprocessing manager.

I have tried this in Python 2.7.13 and Python 3.6.0 and assume the problem still exists in between and beyond.

The problem appears when I try to delegate the connect() method of a multiprocessing manager client to a thread. The first time the procedure takes place, everything works fine and there is no problem of shared memory or anything. The problem arises on the second and forth trials of connect, when there seems to be a memory sharing problem. To reproduce the problem you have to run the server.py and client.py modules. You can see that the client is capable of populating the server's queue. If you terminate the server.py process and start it again, the client can no longer reassign the remote queue. Actually, reconnecting to the server always take place, as well as the correct linkage to the remote queue on line 53 of bridge.py:

self.items_buffer = self.remote_manager.items_buffer()

but the problem is that this procedure no longer works after the first time. Even though the connection is re-established, and at the moment of reconnection it is possible to send info to the server, whenever the thread dies, the pipe gets somehow broken.

----------
components: Interpreter Core
files: case.zip
messages: 284661
nosy: Luciano Dionisio
priority: normal
severity: normal
status: open
title: Possible glitch in the interaction of a thread and a multiprocessing manager
type: crash
versions: Python 2.7, Python 3.6
Added file: http://bugs.python.org/file46145/case.zip

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29158>
_______________________________________


More information about the New-bugs-announce mailing list