gh-120158: Fix inconsistent monitoring state when setting events too … · python/cpython@e457d60 · GitHub
Skip to content

Commit e457d60

Browse files
authored
gh-120158: Fix inconsistent monitoring state when setting events too frequently (gh-141845)
If we overflowed the global version counter (i.e., after 2*24 calls to `_PyMonitoring_SetEvents`), we bailed out after setting global monitoring events but before instrumenting code objects, which led to assertion errors later on. Also add a `time.sleep()` to `test_free_threading.test_monitoring` to avoid overflowing the global version counter.
1 parent 614a28b commit e457d60

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/test/test_free_threading/test_monitoring.py

Lines changed: 3 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix inconsistent state when enabling or disabling monitoring events too many
2+
times.

Python/instrumentation.c

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)