Skip to content

fix: resolve core engine concurrency hangs - #571

Merged
kaifcodec merged 3 commits into
mainfrom
fix-core-hangs
Aug 13, 2026
Merged

fix: resolve core engine concurrency hangs#571
kaifcodec merged 3 commits into
mainfrom
fix-core-hangs

Conversation

@kaifcodec

Copy link
Copy Markdown
Owner

This PR addresses several critical issues causing scans to hang or freeze mid-execution:

  • Global Lock Stalls in Impersonate Requests: Implemented fine-grained _key_locks in impersonate.py so that warmup requests only block threads using the exact same proxy and impersonation profile, preventing a single slow warmup from freezing the entire engine.
  • Thread Pool Starvation from Dropped Connections: Wrapped module execution in asyncio.wait_for to strictly enforce execution timeouts. Additionally, decoupled the semaphore limit from the underlying thread pool, scaling it dynamically (up to 250 threads by default) so orphaned threads don't starve the concurrency engine.
  • Asynchronous Email Scanning: Wrapped email modules in asyncio.create_task to schedule them immediately on the global event loop, enabling true global concurrency.
  • Real-time Smooth Progress Bar: Attached asyncio callbacks (task.add_done_callback) so the progress bar updates smoothly the millisecond any background task finishes, rather than stuttering between categories.

…sion locks, strict execution timeouts, and dynamic thread pool scaling
@kaifcodec kaifcodec added enhancement New feature, request, code improvements/upgrade, performance boost bug fix Fixed a bug in existing files labels Aug 12, 2026
@kaifcodec kaifcodec self-assigned this Aug 12, 2026
@kaifcodec
kaifcodec marked this pull request as draft August 12, 2026 17:27
…s print correctly during restricted cross-scans
@kaifcodec
kaifcodec marked this pull request as ready for review August 13, 2026 04:52
@kaifcodec
kaifcodec merged commit 736861d into main Aug 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Fixed a bug in existing files enhancement New feature, request, code improvements/upgrade, performance boost

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant