File tree 2 files changed +7
-11
lines changed
2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -67,20 +67,21 @@ def main() -> NoReturn:
67
67
# signal pandad to close the relay and exit
68
68
def signal_handler (signum , frame ):
69
69
cloudlog .info (f"Caught signal { signum } , exiting" )
70
- if process is not None and process . poll () is None :
71
- process . terminate ()
72
- process . wait ()
73
- sys . exit ( 1 )
70
+ nonlocal do_exit
71
+ do_exit = True
72
+ if process is not None :
73
+ process . send_signal ( signal . SIGINT )
74
74
75
75
process = None
76
- signal .signal (signal .SIGTERM , signal_handler )
76
+ signal .signal (signal .SIGINT , signal_handler )
77
77
78
78
count = 0
79
+ do_exit = False
79
80
first_run = True
80
81
params = Params ()
81
82
no_internal_panda_count = 0
82
83
83
- while True :
84
+ while not do_exit :
84
85
try :
85
86
count += 1
86
87
cloudlog .event ("pandad.flash_and_connect" , count = count )
Original file line number Diff line number Diff line change 3
3
import os
4
4
import signal
5
5
import sys
6
- import time
7
6
import traceback
8
7
9
8
from cereal import log
@@ -172,10 +171,6 @@ def manager_thread() -> None:
172
171
cloudlog .warning (f"Shutting down manager - { param } set" )
173
172
174
173
if shutdown :
175
- # Signal processes to shut down with a small grace period
176
- for p in managed_processes .values ():
177
- p .signal (signal .SIGTERM )
178
- time .sleep (1 )
179
174
break
180
175
181
176
You can’t perform that action at this time.
0 commit comments