GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Interpreter shutdown can deadlock when a daemon thread holds the warnings lock · Issue #159485 · python/cpython Open Labels 3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionOriginally reported by @krassowski in #158973. A daemon thread can be stopped while holding the warnings lock. During interpreter finalization, garbage collection triggers a import threading import time import warnings ready = threading.Event() warnings.simplefilter("always", ResourceWarning) class WarnAtShutdown: def __init__(self): self.self_ref = self # Defer __del__ until shutdown GC. def __del__(self): warnings.warn("late", ResourceWarning) def showwarning(message, *args, **kwargs): if str(message) == "hold": ready.set() time.sleep(0.1) warnings.showwarning = showwarning threading.Thread( target=lambda: warnings.warn("hold", ResourceWarning), daemon=True, ).start() assert ready.wait(4) WarnAtShutdown() Expected: the process exits normally. Actual: it hangs during interpreter shutdown.
Linked PRsActivity
MetadataMetadataAssigneesLabels3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |