make the JUNKING log entries "silent" so they don't change frozen status

nor interfere with stuck_timeout

problem noticed by sthen@
This commit is contained in:
espie 2019-10-24 15:05:22 +00:00
parent 63673a988a
commit b9ce115a3d
2 changed files with 26 additions and 6 deletions

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: Clock.pm,v 1.15 2019/09/28 12:22:12 espie Exp $
# $OpenBSD: Clock.pm,v 1.16 2019/10/24 15:05:22 espie Exp $
#
# Copyright (c) 2011-2013 Marc Espie <espie@openbsd.org>
#
@ -130,6 +130,14 @@ sub check_change
return $d;
}
sub adjust_by
{
my ($self, $l) = @_;
if (defined $self->{sz}) {
$self->{sz} += $l;
}
}
sub percent_message
{
my $self = shift;

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: Port.pm,v 1.197 2019/10/23 10:09:50 espie Exp $
# $OpenBSD: Port.pm,v 1.198 2019/10/24 15:05:22 espie Exp $
#
# Copyright (c) 2010-2013 Marc Espie <espie@openbsd.org>
#
@ -700,9 +700,9 @@ sub run
if (!$core->prop->{silentjunking}) {
for my $j ($core->same_host_jobs) {
next if $j eq $job;
print {$j->{logfh}}
$j->silent_log(
">> JUNKING in $job->{path}:\n",
">> $s";
">> $s");
}
}
@ -723,8 +723,8 @@ sub finalize
if (!$core->prop->{silentjunking}) {
for my $j ($core->same_host_jobs) {
next if $j eq $job;
print {$j->{logfh}}
">> JUNKING end in $job->{path}\n";
$j->silent_log(
">> JUNKING end in $job->{path}\n");
}
}
$core->prop->{last_junk} = $job->{v};
@ -1200,6 +1200,18 @@ sub new
return $job;
}
sub silent_log
{
my $job = shift;
my $msg = join(@_);
my $old = $job->{logfh}->autoflush(1);
print {$job->{logfh}} $msg;
$job->{logfh}->autoflush($old);
if (defined $job->{watched}) {
$job->{watched}->adjust_by(length($msg));
}
}
sub new_junk_only
{
my $class = shift;