]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx*: name child subprocesses
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Sat, 24 Feb 2018 00:29:51 +0000 (00:29 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Wed, 28 Feb 2018 18:53:29 +0000 (18:53 +0000)
This makes viewing "ps" output nicer.

lib/PublicInbox/SearchIdxPart.pm
lib/PublicInbox/SearchIdxThread.pm

index e37887a766920a539ca0ea8d5f9d5e2f652aa8f8..bffa53255f447ab40a6c01a94ba8822f70ce55fc 100644 (file)
@@ -24,7 +24,7 @@ sub new {
                # speeds V2Writable batch imports across 8 cores by nearly 20%
                fcntl($r, 1031, 1048576) if $^O eq 'linux';
 
-               eval { partition_worker_loop($self, $r) };
+               eval { partition_worker_loop($self, $r, $part) };
                die "worker $part died: $@\n" if $@;
                die "unexpected MM $self->{mm}" if $self->{mm};
                exit;
@@ -35,8 +35,9 @@ sub new {
        $self;
 }
 
-sub partition_worker_loop ($$) {
-       my ($self, $r) = @_;
+sub partition_worker_loop ($$$) {
+       my ($self, $r, $part) = @_;
+       $0 = "pi-v2-partition[$part]";
        my $xdb = $self->_xdb_acquire;
        $xdb->begin_transaction;
        my $txn = 1;
index 7df07a65dde31bc1e7f0c0a996968330fda337f0..fd133d1d13eca307112561cb7a84e1e8f64c30b5 100644 (file)
@@ -41,6 +41,7 @@ sub new {
 
 sub thread_worker_loop {
        my ($self, $r) = @_;
+       $0 = 'pi-v2-threader';
        my $msg;
        my $xdb = $self->_xdb_acquire;
        $xdb->begin_transaction;