HIGH SEVERITYCONFIRMED

asyncio.Lock() at module level causes cross-thread deadlock

Package
DeerFlow
Version
latest
Verified
2026-03-28

Description

DeerFlow creates an `asyncio.Lock()` at module level. A lock acquired in one thread's event loop cannot be released from a different thread's event loop. When two threads share the module-level lock, the second thread deadlocks with `TimeoutError`.

Reproduction

# Module-level: lock = asyncio.Lock()
# Thread 1 acquires lock in its event loop
# Thread 2 attempts to acquire lock in a different event loop
# Thread 2 times out with TimeoutError — deadlock confirmed
← All bugsScan your code →