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.
Created on 2008年10月23日 20:28 by gpolo, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| move_Thread__started.diff | gpolo, 2008年10月23日 20:28 | review | ||
| verbosethreading.patch | pitrou, 2010年07月31日 11:51 | review | ||
| Messages (10) | |||
|---|---|---|---|
| msg75149 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2008年10月23日 20:28 | |
Lib/threading.py gets into infinite recursion while testing (or using) it with verbose set. This didn't happen before because Thread.__started didn't use to be an Event, but now it is. Typical situation: _DummyThread calls _Thread__started.set, which calls __started.__cond.notify_all(), which calls __cond.notify(). If there are no waiters, it calls _Verbose._note, which calls currentThread, but if there is no current thread _DummyThread is called, which calls _Thread__started.set ... |
|||
| msg112131 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010年07月31日 11:18 | |
Could someone with knowledge of threading provide a unit test for this, assuming that you want or need to force threading into infinite recursion. Then we can test a patch that only moves two lines. |
|||
| msg112136 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年07月31日 11:34 | |
The patch looks ok. A more robust solution would be to modify _note() so that it never creates a DummyThread, and instead uses the raw thread id if the current thread doesn't have a corresponding Thread object. |
|||
| msg112139 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年07月31日 11:38 | |
I spoke too fast. With the patch, test_3_join_in_forked_from_thread in test_threading still fails with _VERBOSE manually set to True. |
|||
| msg112145 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年07月31日 11:51 | |
Here is a patch with the alternative approach suggested above. There still is the aforementioned test_threading issue when run standalone. |
|||
| msg124232 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2010年12月17日 17:24 | |
I can confirm that the patch fixes the recursion problem if threading._VERBOSE is set to true, but the test Antoine mentioned hangs when the test suite is run. _VERBOSE is an internal, undocumented facility, so perhaps the priority on this isn't really "high". On the other hand, Antoine's patch takes things from non-functional to at least partially functional, so perhaps it is worth applying as is, pending someone figuring out where the test hang is coming from. I looked in to this briefly, but I have no clue how to trigger this in a unit test, since it seems to happen when regrtest imports logging which imports threading, and appears to my threading-ignorant eyes to be tied to conditions that only exist at initial module import. |
|||
| msg124235 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年12月17日 17:46 | |
Ok, I committed the patch in r87341 (3.2), r87342 (3.1) and r87343 (2.7). |
|||
| msg125284 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2011年01月04日 02:26 | |
The hanging test still hangs for me with _VERBOSE set to True on py3k trunk. |
|||
| msg125286 - (view) | Author: Gregory P. Smith (gregory.p.smith) * (Python committer) | Date: 2011年01月04日 02:42 | |
sorry, i saw the patches committed and thought that had fixed it. oops. still more to be done. |
|||
| msg210321 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2014年02月05日 14:52 | |
The threading._VERBOSE attribute was removed in issue 13550 (see also changeset http://hg.python.org/cpython/rev/8ec51b2e57c2). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:40 | admin | set | github: 48438 |
| 2014年02月05日 14:52:05 | berker.peksag | set | status: open -> closed nosy: + berker.peksag messages: + msg210321 resolution: out of date stage: needs patch -> resolved |
| 2014年02月03日 19:08:04 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2012年09月13日 21:14:57 | Anthony.Kong | set | nosy:
+ Anthony.Kong |
| 2012年01月04日 04:37:31 | jcea | set | nosy:
+ jcea |
| 2011年01月04日 02:42:54 | gregory.p.smith | set | nosy:
gregory.p.smith, pitrou, gps, gpolo, r.david.murray, meador.inge, BreamoreBoy messages: + msg125286 |
| 2011年01月04日 02:26:21 | r.david.murray | set | status: closed -> open messages: + msg125284 resolution: fixed -> (no value) nosy: gregory.p.smith, pitrou, gps, gpolo, r.david.murray, meador.inge, BreamoreBoy |
| 2011年01月04日 00:15:12 | gregory.p.smith | set | status: open -> closed nosy: gregory.p.smith, pitrou, gps, gpolo, r.david.murray, meador.inge, BreamoreBoy resolution: fixed |
| 2011年01月04日 00:12:35 | gregory.p.smith | set | assignee: gregory.p.smith nosy: + gregory.p.smith |
| 2010年12月17日 17:46:08 | pitrou | set | priority: high -> normal title: Lib/threading.py causes infinite recursion when running as verbose -> test_threading hang when running as verbose nosy: pitrou, gps, gpolo, r.david.murray, meador.inge, BreamoreBoy messages: + msg124235 stage: patch review -> needs patch |
| 2010年12月17日 17:24:29 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg124232 versions: - Python 2.6 |
| 2010年08月03日 13:52:59 | meador.inge | set | nosy:
+ meador.inge |
| 2010年07月31日 11:51:47 | pitrou | set | files:
+ verbosethreading.patch messages: + msg112145 |
| 2010年07月31日 11:38:20 | pitrou | set | messages: + msg112139 |
| 2010年07月31日 11:34:35 | pitrou | set | nosy:
+ pitrou, gps messages: + msg112136 stage: test needed -> patch review |
| 2010年07月31日 11:18:25 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg112131 |
| 2010年05月11日 20:54:13 | terry.reedy | set | versions: + Python 3.2, - Python 3.0 |
| 2009年05月16日 01:14:49 | ajaksu2 | set | priority: high type: behavior stage: test needed |
| 2008年10月23日 20:28:22 | gpolo | create | |