Skip to content

Commit

Permalink
bugfix: make sure rickshaw-run knows how to handle a waiting abort si…
Browse files Browse the repository at this point in the history
…gnal
  • Loading branch information
k-rister committed May 28, 2024
1 parent c2cf489 commit 2039a35
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rickshaw-run
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ my $roadblock_exit_success = 0;
my $roadblock_exit_timeout = 3;
my $roadblock_exit_abort = 4;
my $roadblock_exit_input = 2;
my $roadblock_exit_abort_waiting = 6;
my $abort_via_roadblock = 0;
my $workshop_base_cmd;
my $workshop_force_builds;
Expand Down Expand Up @@ -241,7 +242,7 @@ sub do_roadblock {
(my $date_cmd, my $date, my $date_rc) = run_cmd('date');
chomp $date;
printf "Roadblock: %s ", $date;
while ($attempts < $run{'max-rb-attempts'} and $rc != $roadblock_exit_success and $rc != $roadblock_exit_abort) {
while ($attempts < $run{'max-rb-attempts'} and $rc != $roadblock_exit_success and $rc != $roadblock_exit_abort and $rc != $roadblock_exit_abort_waiting) {
$attempts++;
my $this_uuid = $attempts . ":" . $uuid;
printf "role: %s ", $role;
Expand Down Expand Up @@ -275,7 +276,7 @@ sub do_roadblock {
printf "roadblock rc: %d\n", $rc;
printf "roadblock output END\n";
}
if ( $rc == $roadblock_exit_abort ) {
if ( $rc == $roadblock_exit_abort or $rc == $roadblock_exit_abort_waiting ) {
printf "roadblock messages\n";
foreach my $msg (@{ $_[0]{'received'} }) {
if (exists $$msg{'payload'}{'message'}{'user-object'} and exists $$msg{'payload'}{'message'}{'user-object'}{'error'}) {
Expand All @@ -284,7 +285,7 @@ sub do_roadblock {
}
}
}
if ($rc == $roadblock_exit_abort or $rc == $roadblock_exit_success) {
if ($rc == $roadblock_exit_abort or $rc == $roadblock_exit_success or $rc == $roadblock_exit_abort_waiting ) {
($file_rc, $_[0]) = get_json_file($msgs_log_file);
if ($file_rc > 0 or ! defined $_[0]) {
printf "Could not open the messages log file on abort/exit: %s\n". $msgs_log_file;
Expand Down Expand Up @@ -2721,7 +2722,7 @@ sub evaluate_test_roadblock {
remove_dropped_followers($active_followers, $dropped_followers);

$quit = 1;
} elsif ($roadblock_rc == $roadblock_exit_abort) {
} elsif ($roadblock_rc == $roadblock_exit_abort or $roadblock_rc == $roadblock_exit_abort_waiting) {
if ($abort == 0) {
printf "[WARNING] roadblock '%s' received an abort, stopping sample\n", $roadblock_name;
$$sample_info->{'attempt-fail'} = 1;
Expand Down

0 comments on commit 2039a35

Please sign in to comment.