Immediately cancel all limits after run terminates
In container mode, if copying output files took a long time, the
wall-time limit would be still running and could mark runs as failed if
violated, although the run itself terminated successfully before the
limit was reached.
@@ -1070,6 +1070,9 @@ class RunExecutor(containerexecutor.ContainerExecutor):
This method executes the command line and waits for the termination of it,
handling all setup and cleanup, but does not check whether arguments are valid.
"""
+ timelimitThread = None
+ oomThread = None
+ file_hierarchy_limit_thread = None
if self._energy_measurement is not None:
# Calculate which packages we should use for energy measurements
@@ -1115,6 +1118,16 @@ class RunExecutor(containerexecutor.ContainerExecutor):
if FREEZER in cgroups:
cgroups.kill_all_tasks(self._kill_process0)
+ # For a similar reason, we cancel all limits. Otherwise a run could have
+ # terminationreason=walltime because copying output files took a long time.
+ # Can be removed if #433 gets implemented properly.
+ if timelimitThread:
+ timelimitThread.cancel()
+ if oomThread:
+ oomThread.cancel()
+ if file_hierarchy_limit_thread:
+ file_hierarchy_limit_thread.cancel()
+
if exit_code.value not in [0, 1]:
_get_debug_output_after_crash(output_filename, base_path)
@@ -1140,9 +1153,6 @@ class RunExecutor(containerexecutor.ContainerExecutor):
error_filename, args, write_header=write_header
)
- timelimitThread = None
- oomThread = None
- file_hierarchy_limit_thread = None
pid = None
returnvalue = 0
ru_child = None
