[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 03/03: c/r-lintian-h: Exit 2 when lintian is killed due to alarms



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 62532f8b20e946e32a3bba2dcc5c71202e040c8b
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Aug 14 11:20:35 2016 +0000

    c/r-lintian-h: Exit 2 when lintian is killed due to alarms
    
    Otherwise, we end up skipping the report generation, which is not
    really what we wanted in this case.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 commands/reporting-lintian-harness.pm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/commands/reporting-lintian-harness.pm b/commands/reporting-lintian-harness.pm
index ca46211..de6f015 100644
--- a/commands/reporting-lintian-harness.pm
+++ b/commands/reporting-lintian-harness.pm
@@ -219,6 +219,7 @@ sub process_worklist {
         my $len = scalar @worklist;
         my (@work_splice, @completed, %processed);
         my ($lintpipe, $lint_stdin, $status_fd, $lint_status_out);
+        my $got_alarm = 0;
 
         # Bail if there is less than 5 minutes left
         if (time() >= $start_time + BACKLOG_PROCESSING_TIME_LIMIT - 300) {
@@ -305,6 +306,11 @@ sub process_worklist {
             my $sig_handler = sub {
                 my ($signal_name) = @_;
                 $count++;
+                if ($signal_name eq 'ALRM') {
+                    $got_alarm = 1 if $got_alarm >= 0;
+                } else {
+                    $got_alarm = -1;
+                }
                 if ($count < 3) {
                     log_msg("Received SIG${signal_name}, "
                           . "sending SIGTERM to $pid [${count}/3]");
@@ -364,7 +370,15 @@ sub process_worklist {
                 # don't start the next round.
                 log_msg(' - skipping the rest of the worklist');
                 @worklist = ();
-                $exit_code = 3;
+                if ($got_alarm == 1) {
+                    # Lintian was (presumably) killed due to a
+                    # time-out from this process
+                    $exit_code = 2;
+                } else {
+                    # Lintian was killed by another signal; notify
+                    # harness that it should skip the rest as well.
+                    $exit_code = 3;
+                }
             }
         } else {
             log_msg('Lintian finished successfully');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: