mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 23:29:59 -07:00
Fix signal handler deadlock and add satellite TLE data
Remove logging and cleanup_all_processes() from signal handler to prevent deadlocks when another thread holds the logging or process lock. Process cleanup is handled by the atexit handler instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,11 +85,13 @@ atexit.register(cleanup_all_processes)
|
||||
|
||||
# Handle signals for graceful shutdown
|
||||
def _signal_handler(signum, frame):
|
||||
"""Handle termination signals."""
|
||||
"""Handle termination signals.
|
||||
|
||||
Keep this minimal — logging and lock acquisition in signal handlers
|
||||
can deadlock when another thread holds the logging or process lock.
|
||||
Process cleanup is handled by the atexit handler registered above.
|
||||
"""
|
||||
import sys
|
||||
logger.info(f"Received signal {signum}, cleaning up...")
|
||||
cleanup_all_processes()
|
||||
# Re-raise KeyboardInterrupt for SIGINT so Flask can handle shutdown
|
||||
if signum == signal.SIGINT:
|
||||
raise KeyboardInterrupt()
|
||||
sys.exit(0)
|
||||
|
||||
Reference in New Issue
Block a user