tags 693790 + pending
thanks

On Tue, Nov 20, 2012 at 11:31:27AM +0000, Colin Watson wrote:
> I've tweaked the "$main::sbuild_fails > 2" test to read
> "$main::sbuild_fails > 20" instead, and it seems to be behaving quite
> reasonably.  Would it be possible to make this threshold configurable so
> that I don't have to change the code to do this?

Could you please try the attached patch.  This should make it
configurable via $max_sbuild_fails in buildd.conf (which
continues to default to 2, but will allow you to set it higher).


Thanks,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
diff --git a/lib/Buildd/Conf.pm b/lib/Buildd/Conf.pm
index 1cf5063..783fde7 100644
--- a/lib/Buildd/Conf.pm
+++ b/lib/Buildd/Conf.pm
@@ -174,6 +174,13 @@ sub setup ($) {
 	    DEFAULT => 0,
 	    HELP => 'Log success messages from upload queue daemon?'
 	},
+	'MAX_SBUILD_FAILS'				=> {
+	    TYPE => 'NUMERIC',
+	    VARNAME => 'max_sbuild_fails',
+	    GROUP => 'Daemon',
+	    DEFAULT => 2,
+	    HELP => 'Maximim number of times sbuild can fail before sleeping'
+	},
 	'MIN_FREE_SPACE'			=> {
 	    TYPE => 'NUMERIC',
 	    VARNAME => 'min_free_space',
diff --git a/lib/Buildd/Daemon.pm b/lib/Buildd/Daemon.pm
index 282e06d..f86179a 100644
--- a/lib/Buildd/Daemon.pm
+++ b/lib/Buildd/Daemon.pm
@@ -632,7 +632,7 @@ sub do_build {
 
 	$main::sbuild_fails++;
 
-	if ($main::sbuild_fails > 2) {
+	if ($main::sbuild_fails > $self->get_conf('MAX_SBUILD_FAILS')) {
 	    $self->log("sbuild now failed $main::sbuild_fails times in ".
 		       "a row; going to sleep\n");
 	    send_mail( $self->get_conf('ADMIN_MAIL'),

Reply via email to