[issue35294] Race condition involving SocketServer.TCPServer

Ruslan Dautkhanov report at bugs.python.org
Wed Nov 21 20:02:32 EST 2018


New submission from Ruslan Dautkhanov <dautkhanov at gmail.com>:

We had a long discussion in https://issues.apache.org/jira/browse/SPARK-26019
regarding a race condition that happens 
around https://github.com/apache/spark/blob/master/python/pyspark/accumulators.py#L289 

The fix I created here -
https://github.com/apache/spark/pull/23113/files
basically changes bind_and_activate to False 
in SocketServer.TCPServer.__init__'s call 
and manually doing 
            self.server_bind()
            self.server_activate()
            self.serve_forever()
in that thread instead of main thread. 

We have a fix, but we're not sure if this is a bug in Python with multithreading / handling SocketServer.TCPServer ?

Thank you.

----------
components: IO, Library (Lib)
messages: 330228
nosy: Ruslan Dautkhanov
priority: normal
severity: normal
status: open
title: Race condition involving SocketServer.TCPServer
versions: Python 2.7, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35294>
_______________________________________


More information about the Python-bugs-list mailing list