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 to7m
Recipients to7m
Date 2020-12-13.23:37:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1607902678.82.0.104927232585.issue42631@roundup.psfhosted.org>
In-reply-to
Content
As best I can tell, sometimes when a Listener or Connection is not properly initialised, the Client fails to communicate properly with it. Instead of raising an exception, the Client hangs.


receiver.py:


from multiprocessing.connection import Listener

while True:
    with Listener(("localhost", 10000), authkey=b"test") as listener:
        with listener.accept() as connection:
            print(connection.recv())


client.py (intended as a stress test):


from multiprocessing.connection import Client

for i in range(1000):
    successfully_sent = False
    while not successfully_sent:
        try:
            with Client(("localhost", 10000), authkey=b"test") as client:
                client.send(i)
        except (ConnectionRefusedError, ConnectionResetError):
            continue
        successfully_sent = True


Also noteworthy: I posted on StackExchange (https://stackoverflow.com/questions/65276145/multiprocessing-receive-all-messages-from-multiple-runtimes) and it seems that the code there (only 1000 messages) took around an hour to run for a Windows user, whereas it would take less than a second to successfully run on Linux.
History
Date User Action Args
2020-12-13 23:37:58to7msetrecipients: + to7m
2020-12-13 23:37:58to7msetmessageid: <1607902678.82.0.104927232585.issue42631@roundup.psfhosted.org>
2020-12-13 23:37:58to7mlinkissue42631 messages
2020-12-13 23:37:58to7mcreate