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 Dima.Tisnek
Recipients Dima.Tisnek
Date 2016-08-31.07:27:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472628459.0.0.615351058754.issue27908@psf.upfronthosting.co.za>
In-reply-to
Content
To reproduce:

```
import threading
import time


class U(threading.Thread):
    def run(self):
        time.sleep(1)
        if not x.ident:
            x.start()


x = U()
for u in [U() for i in range(10000)]: u.start()

time.sleep(10)
```

Chance to reproduce ~20% in my setup.
This script has a data race (check then act on x.ident).
I expected it to occasionally hit `RuntimeError: threads can only be started once`

Instead, I get:
```
Unhandled exception in thread started by <bound method Thread._bootstrap of <U(Thread-1, started 139798116361984)>>
Traceback (most recent call last):
  File "/usr/lib64/python3.5/threading.py", line 882, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib64/python3.5/threading.py", line 906, in _bootstrap_inner
    del _limbo[self]
KeyError: <U(Thread-1, started 139798116361984)>
```
History
Date User Action Args
2016-08-31 07:27:39Dima.Tisneksetrecipients: + Dima.Tisnek
2016-08-31 07:27:39Dima.Tisneksetmessageid: <1472628459.0.0.615351058754.issue27908@psf.upfronthosting.co.za>
2016-08-31 07:27:38Dima.Tisneklinkissue27908 messages
2016-08-31 07:27:38Dima.Tisnekcreate