Skip to content

Fix stderr lock crash during interpreter shutdown - #2989

Merged
TheTechromancer merged 1 commit into
3.0from
fix-shutdown-stderr-crash
Mar 26, 2026
Merged

Fix stderr lock crash during interpreter shutdown#2989
TheTechromancer merged 1 commit into
3.0from
fix-shutdown-stderr-crash

Conversation

@liquidsec

Copy link
Copy Markdown
Collaborator

Summary

  • Stop QueueListener synchronously in atexit handler instead of spawning a daemon thread that gets killed mid-write during Python finalization
  • Fixes Fatal Python error: _enter_buffered_busy: could not acquire lock for <_io.BufferedWriter name='<stderr>'> at shutdown

Stop QueueListener synchronously in atexit handler instead of spawning
a daemon thread that gets killed mid-write during finalization.
@github-actions

Copy link
Copy Markdown
Contributor

📊 Performance Benchmark Report

Comparing 3.0 (baseline) vs fix-shutdown-stderr-crash (current)

📈 Detailed Results (All Benchmarks)

📋 Complete results for all benchmarks - includes both significant and insignificant changes

🧪 Test Name 📏 Base 📏 Current 📈 Change 🎯 Status
Bloom Filter Dns Mutation Tracking Performance 4.10ms 3.97ms -3.0%
Bloom Filter Large Scale Dns Brute Force 18.57ms 17.97ms -3.2%
Large Closest Match Lookup 333.64ms 323.59ms -3.0%
Realistic Closest Match Workload 177.63ms 174.29ms -1.9%
Event Memory Medium Scan 1764 B/event 1765 B/event +0.1%
Event Memory Large Scan 1756 B/event 1756 B/event -0.0%
Event Validation Full Scan Startup Small Batch 367.94ms 368.58ms +0.2%
Event Validation Full Scan Startup Large Batch 520.30ms 519.96ms -0.1%
Make Event Autodetection Small 26.35ms 26.10ms -0.9%
Make Event Autodetection Large 266.17ms 266.73ms +0.2%
Make Event Explicit Types 11.58ms 11.51ms -0.6%
Excavate Single Thread Small 3.485s 3.424s -1.8%
Excavate Single Thread Large 9.233s 9.207s -0.3%
Excavate Parallel Tasks Small 3.660s 3.622s -1.0%
Excavate Parallel Tasks Large 7.023s 6.999s -0.3%
Is Ip Performance 2.94ms 2.92ms -0.6%
Make Ip Type Performance 10.68ms 10.70ms +0.2%
Mixed Ip Operations 4.19ms 4.15ms -1.0%
Typical Queue Shuffle 54.98µs 54.64µs -0.6%
Priority Queue Shuffle 607.31µs 600.83µs -1.1%

🎯 Performance Summary

No significant performance changes detected (all changes <10%)


🐍 Python Version 3.11.15

@codecov

codecov Bot commented Mar 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91%. Comparing base (3a6f2ec) to head (d45d2a4).
⚠️ Report is 3 commits behind head on 3.0.

Files with missing lines Patch % Lines
bbot/core/config/logger.py 0% 3 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             3.0   #2989   +/-   ##
=====================================
+ Coverage     91%     91%   +1%     
=====================================
  Files        436     436           
  Lines      36960   36957    -3     
=====================================
- Hits       33587   33585    -2     
+ Misses      3373    3372    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheTechromancer
TheTechromancer merged commit 9e28b27 into 3.0 Mar 26, 2026
16 checks passed
@liquidsec liquidsec mentioned this pull request Jun 9, 2026
@ausmaster
ausmaster deleted the fix-shutdown-stderr-crash branch June 11, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants