diff options
author | Eric Wong <e@80x24.org> | 2024-04-25 21:31:46 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2024-04-28 17:05:29 +0000 |
commit | cccff5cbaf8e9800dbcb67dd497586bdb0a8521e (patch) | |
tree | da3292d5a6d59509fbac435479620fd44d2aee1b /lib/PublicInbox/XapClient.pm | |
parent | bad65d1197b8ee45a28e8bb7c894912145012fb5 (diff) | |
download | public-inbox-cccff5cbaf8e9800dbcb67dd497586bdb0a8521e.tar.gz |
Xapian helper processes are disabled by default once again. However, they can be enabled via the new `-X INTEGER' parameter. One big positive is the Xapian helpers being spawned by the top-level daemon means they can be shared freely across all workers for improved load balancing and memory reduction.
Diffstat (limited to 'lib/PublicInbox/XapClient.pm')
-rw-r--r-- | lib/PublicInbox/XapClient.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/XapClient.pm b/lib/PublicInbox/XapClient.pm index f0270091..24b3f45e 100644 --- a/lib/PublicInbox/XapClient.pm +++ b/lib/PublicInbox/XapClient.pm @@ -12,6 +12,7 @@ use PublicInbox::Spawn qw(spawn); use Socket qw(AF_UNIX SOCK_SEQPACKET); use PublicInbox::IPC; use autodie qw(pipe socketpair); +our $tries = 50; sub mkreq { my ($self, $ios, @arg) = @_; @@ -19,13 +20,13 @@ sub mkreq { pipe($r, $ios->[0]) if !defined($ios->[0]); my @fds = map fileno($_), @$ios; my $buf = join("\0", @arg, ''); - $n = $PublicInbox::IPC::send_cmd->($self->{io}, \@fds, $buf, 0) // - die "send_cmd: $!"; + $n = $PublicInbox::IPC::send_cmd->($self->{io}, \@fds, $buf, 0, $tries) + // die "send_cmd: $!"; $n == length($buf) or die "send_cmd: $n != ".length($buf); $r; } -sub start_helper { +sub start_helper (@) { $PublicInbox::IPC::send_cmd or return; # can't work w/o SCM_RIGHTS my @argv = @_; socketpair(my $sock, my $in, AF_UNIX, SOCK_SEQPACKET, 0); |