From 8d3550a05e3bbb3ef923fa46fe43ad8927c60e1f Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Sat, 24 Feb 2018 00:29:51 +0000 Subject: searchidx*: name child subprocesses This makes viewing "ps" output nicer. --- lib/PublicInbox/SearchIdxPart.pm | 7 ++++--- lib/PublicInbox/SearchIdxThread.pm | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/SearchIdxPart.pm b/lib/PublicInbox/SearchIdxPart.pm index e37887a7..bffa5325 100644 --- a/lib/PublicInbox/SearchIdxPart.pm +++ b/lib/PublicInbox/SearchIdxPart.pm @@ -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; diff --git a/lib/PublicInbox/SearchIdxThread.pm b/lib/PublicInbox/SearchIdxThread.pm index 7df07a65..fd133d1d 100644 --- a/lib/PublicInbox/SearchIdxThread.pm +++ b/lib/PublicInbox/SearchIdxThread.pm @@ -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; -- cgit v1.2.3-24-ge0c7