Keep Track of Where Each Python Thread Was Started
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Feature or enhancement
Proposal:
Debugging threads can be tricky. One thing that could sometimes help would be knowing where Thread.start() was called. We could achieve this by capturing the traceback of the call and attaching it to the thread. We probably wouldn't want to keep the actual traceback, due to how that would leak all the frames, etc. Instead, we'd probably want to use traceback.TracebackSummary or perhaps even something more lightweight. (FYI, there are other places where such a lightweight traceback snapshot would be useful.)
FWIW, the same sort of tracking might be helpful for coroutines (asyncio), though this is partly addressed by https://github.com/python/cpython/pull/124640.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den Einstiegspunkt Thread.start() und traceback.TracebackSummary zu lesen, um die vorgeschlagenen Grenzen für Erfassung und Speicherung zu verstehen. Lege das Design mit den threading-Maintainern fest und füge anschließend Tests hinzu, die zeigen, dass ein Thread festhält, wo er gestartet wurde, ohne aktive Traceback-Frames beizubehalten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- operating-systems
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100