File tree 1 file changed +10
-1
lines changed 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,19 @@ def check_timeouts():
48
48
def stop_nexttrace_for_sid (sid ):
49
49
task = clients .get (sid )
50
50
if task and task .process :
51
+ logging .info (f"Attempting to terminate process for client { sid } " )
51
52
task .process .terminate ()
53
+ try :
54
+ task .process .wait (timeout = 1 )
55
+ logging .info (f"Process terminated successfully for client { sid } " )
56
+ except subprocess .TimeoutExpired :
57
+ logging .warning (f"Process termination timeout for client { sid } , forcing kill" )
58
+ task .process .kill ()
59
+ logging .info (f"Process killed forcefully for client { sid } " )
52
60
socketio .emit ('nexttrace_complete' , room = sid )
53
61
if sid in clients :
54
62
del clients [sid ]
55
- logging .debug (f"Client { sid } removed from clients dictionary after process termination" )
63
+ logging .info (f"Client { sid } removed from clients dictionary after process termination" )
56
64
57
65
58
66
Thread (target = check_timeouts , daemon = True ).start ()
@@ -247,6 +255,7 @@ def start_nexttrace(data):
247
255
248
256
@socketio .on ('stop_nexttrace' )
249
257
def stop_nexttrace ():
258
+ logging .info (f"Client { request .sid } stop nexttrace" )
250
259
stop_nexttrace_for_sid (request .sid )
251
260
252
261
You can’t perform that action at this time.
0 commit comments