]> Sergey Matveev's repositories - public-inbox.git/commitdiff
ipc: remove WQ_MAX_WORKERS
authorEric Wong <e@80x24.org>
Tue, 17 Aug 2021 08:52:40 +0000 (08:52 +0000)
committerEric Wong <e@80x24.org>
Wed, 18 Aug 2021 11:41:32 +0000 (11:41 +0000)
We no longer rely on IO::FDPass, so there's no longer a reason
to limit this internally.

lib/PublicInbox/IPC.pm

index d909dc1c66357eaa46116e6111ea83cbcb329e0a..9efe551bd2398574f4d82bb4d44e81466f2bd06f 100644 (file)
@@ -20,7 +20,6 @@ use Socket qw(AF_UNIX MSG_EOR SOCK_STREAM);
 my $MY_MAX_ARG_STRLEN = 4096 * 33; # extra 4K for serialization
 my $SEQPACKET = eval { Socket::SOCK_SEQPACKET() }; # portable enough?
 our @EXPORT_OK = qw(ipc_freeze ipc_thaw);
-my $WQ_MAX_WORKERS = 4096;
 my ($enc, $dec);
 # ->imports at BEGIN turns sereal_*_with_object into custom ops on 5.14+
 # and eliminate method call overhead
@@ -354,7 +353,6 @@ sub wq_workers_start {
                die "socketpair: $!";
        $self->ipc_atfork_prepare;
        $nr_workers //= $self->{-wq_nr_workers};
-       $nr_workers = $WQ_MAX_WORKERS if $nr_workers > $WQ_MAX_WORKERS;
        my $sigset = $oldset // PublicInbox::DS::block_signals();
        $self->{-wq_workers} = {};
        $self->{-wq_ident} = $ident;
@@ -367,7 +365,6 @@ sub wq_worker_incr { # SIGTTIN handler
        my ($self, $oldset, $fields) = @_;
        $self->{-wq_s2} or return;
        die "-wq_nr_workers locked" if defined $self->{-wq_nr_workers};
-       return if wq_workers($self) >= $WQ_MAX_WORKERS;
        $self->ipc_atfork_prepare;
        my $sigset = $oldset // PublicInbox::DS::block_signals();
        _wq_worker_start($self, $sigset, $fields);
@@ -443,8 +440,6 @@ sub wq_kill {
        kill($sig // 'TERM', keys %$workers);
 }
 
-sub WQ_MAX_WORKERS { $WQ_MAX_WORKERS }
-
 sub DESTROY {
        my ($self) = @_;
        my $ppid = $self->{-wq_ppid};