about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-05-02 06:05:40 +0000
committerEric Wong <e@80x24.org>2021-05-03 18:45:26 +0000
commit528ef7a3988862763b6ca5b0123be0bf23a64213 (patch)
treee346df9cd13a16047b474ea11a1464287d9412e2
parent34b534d80c36e92cf7dda6cd64a219d33b96d7a1 (diff)
downloadpublic-inbox-528ef7a3988862763b6ca5b0123be0bf23a64213.tar.gz
In most cases, we just name the worker process based
on the command.  The only change is for LeiMirror
vs "lei add-external --mirror", but I doubt it matters.
-rw-r--r--lib/PublicInbox/LEI.pm3
-rw-r--r--lib/PublicInbox/LeiBlob.pm2
-rw-r--r--lib/PublicInbox/LeiConvert.pm2
-rw-r--r--lib/PublicInbox/LeiImport.pm2
-rw-r--r--lib/PublicInbox/LeiLsSearch.pm2
-rw-r--r--lib/PublicInbox/LeiMirror.pm2
-rw-r--r--lib/PublicInbox/LeiP2q.pm2
-rw-r--r--lib/PublicInbox/LeiTag.pm2
8 files changed, 9 insertions, 8 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 5d701d5e..d5c6bd52 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -542,7 +542,7 @@ sub pkt_op_pair {
 }
 
 sub workers_start {
-        my ($lei, $wq, $ident, $jobs, $ops) = @_;
+        my ($lei, $wq, $jobs, $ops) = @_;
         $ops = {
                 '!' => [ \&fail_handler, $lei ],
                 '|' => [ \&sigpipe_handler, $lei ],
@@ -552,6 +552,7 @@ sub workers_start {
         };
         $ops->{''} //= [ $wq->can('_lei_wq_eof') || \&wq_eof, $lei ];
         my $end = $lei->pkt_op_pair;
+        my $ident = $wq->{-wq_ident} // "lei-$lei->{cmd} worker";
         $wq->wq_workers_start($ident, $jobs, $lei->oldset, { lei => $lei });
         delete $lei->{pkt_op_p};
         my $op_c = delete $lei->{pkt_op_c};
diff --git a/lib/PublicInbox/LeiBlob.pm b/lib/PublicInbox/LeiBlob.pm
index 0a957358..710430a2 100644
--- a/lib/PublicInbox/LeiBlob.pm
+++ b/lib/PublicInbox/LeiBlob.pm
@@ -151,7 +151,7 @@ EOM
         }
         require PublicInbox::SolverGit;
         my $self = bless { lxs => $lxs, oid_b => $blob }, __PACKAGE__;
-        my ($op_c, $ops) = $lei->workers_start($self, 'lei-blob', 1);
+        my ($op_c, $ops) = $lei->workers_start($self, 1);
         $lei->{wq1} = $self;
         $self->wq_io_do('do_solve_blob', []);
         $self->wq_close(1);
diff --git a/lib/PublicInbox/LeiConvert.pm b/lib/PublicInbox/LeiConvert.pm
index 5b27ec2d..395a80f8 100644
--- a/lib/PublicInbox/LeiConvert.pm
+++ b/lib/PublicInbox/LeiConvert.pm
@@ -55,7 +55,7 @@ sub lei_convert { # the main "lei convert" method
         my $devfd = $lei->path_to_fd($ovv->{dst}) // return;
         $lei->{opt}->{augment} = 1 if $devfd < 0;
         $self->prepare_inputs($lei, \@inputs) or return;
-        my ($op_c, $ops) = $lei->workers_start($self, 'lei-convert', 1);
+        my ($op_c, $ops) = $lei->workers_start($self, 1);
         $lei->{wq1} = $self;
         $self->wq_io_do('process_inputs', []);
         $self->wq_close(1);
diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm
index 394138b4..6a57df47 100644
--- a/lib/PublicInbox/LeiImport.pm
+++ b/lib/PublicInbox/LeiImport.pm
@@ -76,7 +76,7 @@ sub lei_import { # the main "lei import" method
         $lei->{auth}->op_merge($ops, $self) if $lei->{auth};
         $self->{-wq_nr_workers} = $j // 1; # locked
         $lei->{-eml_noisy} = 1;
-        (my $op_c, $ops) = $lei->workers_start($self, 'lei-import', $j, $ops);
+        (my $op_c, $ops) = $lei->workers_start($self, $j, $ops);
         $lei->{wq1} = $self;
         $lei->{-err_type} = 'non-fatal';
         net_merge_all_done($self) unless $lei->{auth};
diff --git a/lib/PublicInbox/LeiLsSearch.pm b/lib/PublicInbox/LeiLsSearch.pm
index a00e78fc..6cea6ae8 100644
--- a/lib/PublicInbox/LeiLsSearch.pm
+++ b/lib/PublicInbox/LeiLsSearch.pm
@@ -72,7 +72,7 @@ sub do_ls_search_long {
 sub bg_worker ($$$) {
         my ($lei, $pfx, $json) = @_;
         my $self = bless { -wq_nr_workers => 1, json => $json }, __PACKAGE__;
-        my ($op_c, $ops) = $lei->workers_start($self, 'ls-search', 1);
+        my ($op_c, $ops) = $lei->workers_start($self, 1);
         $lei->{wq1} = $self;
         $self->wq_io_do('do_ls_search_long', [], $pfx);
         $self->wq_close(1);
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index db97b98c..a37e1d5c 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -282,7 +282,7 @@ sub start {
         require PublicInbox::Inbox;
         require PublicInbox::Admin;
         require PublicInbox::InboxWritable;
-        my ($op, $ops) = $lei->workers_start($self, 'lei_mirror', 1);
+        my ($op, $ops) = $lei->workers_start($self, 1);
         $lei->{wq1} = $self;
         $self->wq_io_do('do_mirror', []);
         $self->wq_close(1);
diff --git a/lib/PublicInbox/LeiP2q.pm b/lib/PublicInbox/LeiP2q.pm
index b4893489..f381a31c 100644
--- a/lib/PublicInbox/LeiP2q.pm
+++ b/lib/PublicInbox/LeiP2q.pm
@@ -188,7 +188,7 @@ sub lei_p2q { # the "lei patch-to-query" entry point
         } else {
                 $self->{input} = $input;
         }
-        my ($op, $ops) = $lei->workers_start($self, 'lei-p2q', 1);
+        my ($op, $ops) = $lei->workers_start($self, 1);
         $lei->{wq1} = $self;
         $self->wq_io_do('do_p2q', []);
         $self->wq_close(1);
diff --git a/lib/PublicInbox/LeiTag.pm b/lib/PublicInbox/LeiTag.pm
index 6025c93e..c650e886 100644
--- a/lib/PublicInbox/LeiTag.pm
+++ b/lib/PublicInbox/LeiTag.pm
@@ -44,7 +44,7 @@ sub lei_tag { # the "lei tag" method
         $lei->{auth}->op_merge($ops, $self) if $lei->{auth};
         $self->{vmd_mod} = $vmd_mod;
         my $j = $self->{-wq_nr_workers} = 1; # locked for now
-        (my $op_c, $ops) = $lei->workers_start($self, 'lei-tag', $j, $ops);
+        (my $op_c, $ops) = $lei->workers_start($self, $j, $ops);
         $lei->{wq1} = $self;
         $lei->{-err_type} = 'non-fatal';
         net_merge_all_done($self) unless $lei->{auth};