mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 23:29:59 -07:00
fix: zombie IQ process holds USB and stale WS handler clobbers shared state
Two root causes for the waterfall/monitor lockup when scrolling past the 2.4 MHz RTL-SDR span: 1. safe_terminate() sent SIGKILL but never called wait(), leaving a zombie process that kept the USB device handle open. The subsequent capture restart failed the USB probe and the monitor could not use the shared IQ path, falling back to a process-based monitor that stole the SDR from the waterfall. 2. When the frontend created a new WebSocket after a failure, the old handler's finally block called _set_shared_capture_state(running=False) which could race with the new handler's running=True, making the shared monitor path unavailable. Added a generation counter so only the owning handler can clear the shared state.
This commit is contained in:
@@ -76,6 +76,10 @@ def safe_terminate(process: subprocess.Popen | None, timeout: float = 2.0) -> bo
|
||||
return True
|
||||
except subprocess.TimeoutExpired:
|
||||
process.kill()
|
||||
try:
|
||||
process.wait(timeout=3)
|
||||
except subprocess.TimeoutExpired:
|
||||
pass
|
||||
unregister_process(process)
|
||||
return True
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user