summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4b5a1b5)
We need to use DESTROY here to ensure we wait for workers, too;
not just the initial dispatch.
Fixes: cafbd77b3c82167d ("lei up: avoid excessively parallel --all")
$op_c->{ops} = { '' => [ $lei->can('dclose'), $lei ] };
my @first_batch = splice(@$upq, 0, $j); # initial parallelism
$lei->{-upq} = $upq;
$op_c->{ops} = { '' => [ $lei->can('dclose'), $lei ] };
my @first_batch = splice(@$upq, 0, $j); # initial parallelism
$lei->{-upq} = $upq;
+ $lei->{daemon_pid} = $$;
$lei->event_step_init; # wait for client disconnects
for my $out (@first_batch) {
PublicInbox::DS::requeue(
$lei->event_step_init; # wait for client disconnects
for my $out (@first_batch) {
PublicInbox::DS::requeue(
$l->{opt} = { %{$l->{opt}} }; # deep copy
delete $l->{opt}->{all};
$l->qerr("# updating $self->{out}");
$l->{opt} = { %{$l->{opt}} }; # deep copy
delete $l->{opt}->{all};
$l->qerr("# updating $self->{out}");
- $l->{up_op_p} = $self->{op_p}; # ($l => $lei => script/lei)
+ my $o = " (output: $self->{out})"; # add to all warnings
my $cb = $SIG{__WARN__} // \&CORE::warn;
my $cb = $SIG{__WARN__} // \&CORE::warn;
- my $o = " (output: $self->{out})";
local $SIG{__WARN__} = sub {
my @m = @_;
push(@m, $o) if !@m || $m[-1] !~ s/\n\z/$o\n/;
$cb->(@m);
};
local $SIG{__WARN__} = sub {
my @m = @_;
push(@m, $o) if !@m || $m[-1] !~ s/\n\z/$o\n/;
$cb->(@m);
};
eval { $l->dispatch('up', $self->{out}) };
$lei->child_error(0, $@) if $@ || $l->{failed}; # lei->fail()
eval { $l->dispatch('up', $self->{out}) };
$lei->child_error(0, $@) if $@ || $l->{failed}; # lei->fail()
+sub DESTROY {
+ my ($self) = @_;
+ my $lei = $self->{lei}; # the original, from lei_up
+ return if $lei->{daemon_pid} != $$;
my $out = shift(@{$lei->{-upq}}) or return;
PublicInbox::DS::requeue(nxt($lei, $out, $self->{op_p}));
}
my $out = shift(@{$lei->{-upq}}) or return;
PublicInbox::DS::requeue(nxt($lei, $out, $self->{op_p}));
}