Skip to content

Commit

Permalink
Merge branch 'version/2.4' into version/2.5
Browse files Browse the repository at this point in the history
* version/2.4:
  Better detection of the process being killed
  Better detection of the process being killed
  • Loading branch information
muffato committed May 6, 2020
2 parents 6c6d939 + 83fcee8 commit 837b6c4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/Bio/EnsEMBL/Hive/RunnableDB/SystemCmd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,17 @@ sub write_output {
$self->complete_early_if_branch_connected("The command was aborted because it exceeded the allowed runtime. Flowing to the -2 branch.\n", -2);
die "The command was aborted because it exceeded the allowed runtime, but there are no dataflow-rules on branch -2.\n";

} elsif (not ($return_value >> 8)) {
# The job has been killed. The best is to wait a bit that LSF kills
# Lower 8 bits indicate the process has been killed and did not complete.
} elsif ($return_value & 255) {
# It can happen because of a MEMLIMIT / RUNLIMIT, which we
# know are not atomic. The best is to wait a bit that LSF kills
# the worker too
sleep 30;
# If we reach this point, perhaps it was killed by a user
# If we reach this point, it was killed for another reason.
die sprintf( "'%s' was killed with code=%d\nstderr is: %s\n", $flat_cmd, $return_value, $stderr);

} else {
# "Normal" process exit with a non-zero code
# "Normal" process exit with a non-zero code (in the upper 8 bits)
$return_value >>= 8;

# We create a dataflow event depending on the exit code of the process.
Expand Down

0 comments on commit 837b6c4

Please sign in to comment.