Peter Saveliev added the comment:
Possible solution would be something like that in SSLSocket.do_handshake():
try:
self._sslobj.do_handshake()
except SSLError as e: # or even any Exception?
self._sock.close()
raise e
New submission from Peter Saveliev:
Important: only Python2 versions are affected. Python3 works OK.
Possibly related issue: http://bugs.python.org/issue12378 (differs: see the
line above)
Having a server with SSLSocket waiting for connections, the incoming
connection, failed on automatic
Peter Saveliev added the comment:
counter.next() is a C routine and it is atomic from Python's point of view — if
I understand right.
The test shows that original threading.py leads to a (rare) race here, while
with counter object there is no race cond
Peter Saveliev added the comment:
Any news? I hope, the change is trivial enough…
--
___
Python tracker
<http://bugs.python.org/issue11866>
___
___
Python-bug
Peter Saveliev added the comment:
Ok, patch attached.
Patch made for Python: 2.6
Tested Python versions: 2.6, 2.7
--
keywords: +patch
versions: +Python 2.6
Added file: http://bugs.python.org/file21866/newname_race_fix.patch
___
Python tracker
New submission from Peter Saveliev :
The _newname() function has no locking.
It is called from the new thread constructor. Such constructor is executed
within parent thread. So, when several threads create new threads
simultaneously, there can be race condition, leading to the same name for