@@ -101,7 +101,7 @@ def __init__(
101
101
self ._uuid : str = f"{ uuid .uuid4 ()} "
102
102
self ._mode : typing .Literal ["online" , "offline" , "disabled" ] = mode
103
103
self ._name : typing .Optional [str ] = None
104
- self ._abort_on_fail : bool = True
104
+ self ._abort_on_alert : bool = True
105
105
self ._dispatch_mode : typing .Literal ["direct" , "queued" ] = "queued"
106
106
self ._executor = Executor (self )
107
107
self ._dispatcher : typing .Optional [DispatcherBaseClass ] = None
@@ -126,7 +126,6 @@ def __init__(
126
126
self ._shutdown_event : typing .Optional [threading .Event ] = None
127
127
self ._configuration_lock = threading .Lock ()
128
128
self ._heartbeat_termination_trigger : typing .Optional [threading .Event ] = None
129
- self ._alert_raised_trigger : typing .Optional [threading .Event ] = None
130
129
self ._storage_id : typing .Optional [str ] = None
131
130
self ._heartbeat_thread : typing .Optional [threading .Thread ] = None
132
131
self ._heartbeat_interval : int = HEARTBEAT_INTERVAL
@@ -285,8 +284,8 @@ def _heartbeat(
285
284
with self ._configuration_lock :
286
285
if (
287
286
self ._simvue
287
+ and self ._abort_on_alert
288
288
and self ._simvue .get_abort_status ()
289
- and self ._alert_raised_trigger
290
289
):
291
290
self ._alert_raised_trigger .set ()
292
291
self .kill_all_processes ()
@@ -463,13 +462,6 @@ def _error(self, message: str, join_threads: bool = True) -> None:
463
462
self ._heartbeat_termination_trigger .set ()
464
463
if join_threads :
465
464
self ._heartbeat_thread .join ()
466
- if (
467
- self ._abort_on_fail
468
- and self ._alert_raised_trigger
469
- and self ._alert_raised_trigger .is_set ()
470
- ):
471
- self ._aborted = True
472
- self .kill_all_processes ()
473
465
474
466
# Finish stopping all threads
475
467
if self ._shutdown_event :
@@ -842,7 +834,7 @@ def config(
842
834
resources_metrics_interval : typing .Optional [int ] = None ,
843
835
disable_resources_metrics : typing .Optional [bool ] = None ,
844
836
storage_id : typing .Optional [str ] = None ,
845
- abort_on_fail : typing .Optional [bool ] = None ,
837
+ abort_on_alert : typing .Optional [bool ] = None ,
846
838
) -> bool :
847
839
"""Optional configuration
848
840
@@ -859,7 +851,7 @@ def config(
859
851
disable monitoring of resource metrics
860
852
storage_id : str, optional
861
853
identifier of storage to use, by default None
862
- abort_on_fail : bool, optional
854
+ abort_on_alert : bool, optional
863
855
whether to abort the run if an alert is triggered
864
856
865
857
Returns
@@ -888,8 +880,8 @@ def config(
888
880
if resources_metrics_interval :
889
881
self ._resources_metrics_interval = resources_metrics_interval
890
882
891
- if abort_on_fail :
892
- self ._abort_on_fail = abort_on_fail
883
+ if abort_on_alert :
884
+ self ._abort_on_alert = abort_on_alert
893
885
894
886
if storage_id :
895
887
self ._storage_id = storage_id
0 commit comments