Skip to content

Commit b38ed0f

Browse files
committed
update command to terminate thread when container is unhealthy or killed
1 parent da18fcb commit b38ed0f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

core/load.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,16 @@ def wait_until_interrupt(virtual_machine_container_reset_factory_time_seconds, c
363363
start_containers(configuration)
364364
if not new_network_events_thread.is_alive():
365365
error(messages["interrupt_application"])
366-
return True
367-
366+
new_network_events_thread.terminate()
367+
break
368368
if containers_are_unhealthy(configuration):
369369
error(
370370
"Interrupting the application because \"{0}\" container(s) is(are) not alive!".format(
371371
", ".join(containers_are_unhealthy(configuration))
372372
)
373373
)
374-
return True
374+
new_network_events_thread.terminate()
375+
break
375376
if run_as_test:
376377
break
377378
except KeyboardInterrupt:
@@ -887,9 +888,6 @@ def load_honeypot_engine():
887888
)
888889
# killed the network traffic capture process by ctrl + c... waiting to end.
889890
info(messages["killing_capture_process"])
890-
if exit_flag:
891-
# Terminate the network capture process
892-
network_traffic_capture_process.terminate()
893891
if run_as_test:
894892
network_traffic_capture_process.terminate()
895893
# without ci it will be terminate after a few seconds, it needs to kill the tshark and update pcap file collection

0 commit comments

Comments
 (0)