Improve handling of Perl's block eval errors

[?]
May 26, 2020, 8:56 AM
CQZQE32VR5JFHR2AQZVPXCGBHLJCLIZ3IX6NA3SWO2R44XVBSAGAC

Dependencies

  • [2] MIQH5W3F Test: Show error output from hydra-queue-runner on timeout
  • [3] HEZQ273S improve the error messages when invalid declarative jobsets are defined
  • [4] 4ZCUCACY hydra-notify: Fix processing notifications
  • [5] L54KA7IM handleDeclarativeJobsetBuild: handle errors from readNixFile
  • [6] XCXMK24U Keep track of the number of unsupported steps
  • [7] NYTT5WP3 Keep track of the number of unsupported steps
  • [8] 32KJOERM Turn hydra-notify into a daemon
  • [9] VHV6GI4L Add a jobset eval action to restart all aborted/cancelled builds
  • [10] BZSJO2RM hydra-send-stats: Keep track of the number of machines
  • [11] JAH3UPWA Support revision control systems via plugins
  • [12] DWFTK56E Keep track of how many threads are waiting
  • [13] IE2PRAQU hydra-queue-runner: Send build notifications
  • [14] PMNWRTGJ Add multiple output support
  • [15] A2GL5FOZ Moar stats
  • [16] DODOGD7M Send queue runner stats to statsd
  • [17] CHI2EHBJ declarative projects: Pull jobset spec build from the remote store
  • [18] NTEDD7T4 Provide a plugin hook for when build steps finish
  • [19] GFORSLLE add metrics for hydra notifications.
  • [20] 7Q2PXRZA hydra-notify step-finished: Don't barf if the step has no log file
  • [21] 6WRGCITD Enable declarative projects.
  • [22] 3BTJRSU3 GitInput.pm: Don't do a chdir to the Git clone
  • [23] LE4VZIY5 More stats
  • [*] OOQ2D3KC * Refactoring: move fetchInput out of hydra_scheduler into a separate
  • [*] 2GK5DOU7 * Downloading closures.

Change contents

  • replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 77
    [5.65][5.65:94]()
    };
    if ($@) {
    [5.65]
    [5.94]
    } or do {
    # If readNixFile errors or returns an undef or an empty string
  • replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 81
    [5.190][5.190:200]()
    }
    [5.190]
    [5.200]
    };
  • replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 91
    [3.103][3.103:148]()
    };
    if ($@) {
    [3.103]
    [3.148]
    1;
    } or do {
  • edit in src/lib/Hydra/Helper/AddBuilds.pm at line 97
    [8.2729]
    [8.2729]
    1;
    } or do {
    # note the error in the database in the case eval fails for whatever reason
    $project->jobsets->find({ name => ".jobsets" })->update({ errormsg => $@, errortime => time, fetcherrormsg => undef })
  • edit in src/lib/Hydra/Helper/AddBuilds.pm at line 102
    [8.2736][8.2736:2883]()
    $project->jobsets->find({ name => ".jobsets" })->update({ errormsg => $@, errortime => time, fetcherrormsg => undef })
    if defined $@;
  • edit in src/lib/Hydra/Helper/Nix.pm at line 359
    [8.1943]
    [8.1943]
    1;
    } or do {
    die unless $@ eq "timeout\n"; # propagate unexpected errors
    return (-1, $stdout, ($stderr // "") . "timeout\n");
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 365
    [8.1951][8.1951:2033](),[8.2033][2.0:61](),[2.61][8.2071:2123](),[8.2071][8.2071:2123](),[8.2123][8.36:42]()
    if ($@) {
    die unless $@ eq "timeout\n"; # propagate unexpected errors
    return (-1, $stdout, ($stderr // "") . "timeout\n");
    } else {
    return ($?, $stdout, $stderr);
    }
    [8.1951]
    [8.42]
    return ($?, $stdout, $stderr);
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 393
    [8.542][8.542:549]()
    };
    [8.542]
    [8.549]
    $res->{status} = $?;
    chomp $res->{stdout} if $args{chomp} // 0;
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 396
    [8.550][8.550:564]()
    if ($@) {
    [8.550]
    [8.564]
    1;
    } or do {
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 401
    [8.699][8.699:792](),[8.792][8.2123:2129](),[8.2123][8.2123:2129]()
    } else {
    $res->{status} = $?;
    chomp $res->{stdout} if $args{chomp} // 0;
    }
    [8.699]
    [8.793]
    };
  • replacement in src/script/hydra-notify at line 32
    [8.1780][8.1780:1903]()
    eval { $plugin->buildStarted($build); };
    if ($@) {
    print STDERR "$plugin->buildStarted: $@\n";
    [8.1780]
    [8.1903]
    eval {
    $plugin->buildStarted($build);
    1;
    } or do {
    print STDERR "error with $plugin->buildStarted: $@\n";
  • replacement in src/script/hydra-notify at line 58
    [8.3860][8.3860:4000]()
    eval { $plugin->buildFinished($build, [@dependents]); };
    if ($@) {
    print STDERR "$plugin->buildFinished: $@\n";
    [8.3860]
    [8.4000]
    eval {
    $plugin->buildFinished($build, [@dependents]);
    1;
    } or do {
    print STDERR "error with $plugin->buildFinished: $@\n";
  • replacement in src/script/hydra-notify at line 81
    [8.4486][8.4486:4618]()
    eval { $plugin->stepFinished($step, $logPath); };
    if ($@) {
    print STDERR "$plugin->stepFinished: $@\n";
    [8.4486]
    [8.4618]
    eval {
    $plugin->stepFinished($step, $logPath);
    1;
    } or do {
    print STDERR "error with $plugin->stepFinished: $@\n";
  • replacement in src/script/hydra-notify at line 124
    [4.769][4.769:798]()
    };
    if ($@) {
    [4.769]
    [4.798]
    1;
    } or do {
  • edit in src/script/hydra-send-stats at line 38
    [8.1320][7.203:276]()
    gauge("hydra.queue.steps.unsupported", $json->{nrUnsupportedSteps});
  • resolve order conflict in src/script/hydra-send-stats at line 38
    [6.276]
    [8.1320]
  • replacement in src/script/hydra-send-stats at line 63
    [8.1846][8.1846:1911]()
    eval { sendQueueRunnerStats(); };
    if ($@) { warn "$@"; }
    [8.1846]
    [8.1046]
    eval {
    sendQueueRunnerStats();
    1;
    } or do { warn "$@"; }