From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 760A11FAEA for ; Wed, 28 Feb 2018 23:42:08 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 08/21] searchidx*: name child subprocesses Date: Wed, 28 Feb 2018 23:41:49 +0000 Message-Id: <20180228234202.8839-9-e@80x24.org> In-Reply-To: <20180228234202.8839-1-e@80x24.org> References: <20180228234202.8839-1-e@80x24.org> List-Id: This makes viewing "ps" output nicer. --- lib/PublicInbox/SearchIdxPart.pm | 7 ++++--- lib/PublicInbox/SearchIdxThread.pm | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/SearchIdxPart.pm b/lib/PublicInbox/SearchIdxPart.pm index e37887a..bffa532 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 7df07a6..fd133d1 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; -- EW