diff options
author | Eric Wong <e@80x24.org> | 2021-09-06 12:58:02 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-06 22:02:14 +0000 |
commit | 42802a2dba7257226a190598dc0341b7293c7977 (patch) | |
tree | bb51290a3609972c06b2a20d818c873c0dc2e223 /lib | |
parent | 7326e9aadd93ed34ac714f039a81f309cac83db4 (diff) | |
download | public-inbox-42802a2dba7257226a190598dc0341b7293c7977.tar.gz |
It turns out this step is unnecessary, since SOCK_SEQPACKET ordering is guaranteed and we know wq_broadcast calls will always be handled sequentially.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/LeiAuth.pm | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/lib/PublicInbox/LeiAuth.pm b/lib/PublicInbox/LeiAuth.pm index 3155d79b..73c0be59 100644 --- a/lib/PublicInbox/LeiAuth.pm +++ b/lib/PublicInbox/LeiAuth.pm @@ -20,12 +20,7 @@ # broadcast net_merge_all [ all workers (including LeiAuth worker #0) ] # [ LeiAuth worker #0 becomes just another WQ worker ] # | -# | each worker sends net_merge_done1 to lei-daemon -# | | | ... | -# | v v v -# recv net_merge_done1 <--<-------<------/--/--<--/ -# -# call net_merge_all_done ->-> do per-class defined actions +# call net_merge_all_done ->-> do per-WQ-class defined actions package PublicInbox::LeiAuth; use strict; use v5.10.1; @@ -47,31 +42,22 @@ sub do_auth_atfork { # used by IPC WQ workers $lei->fail($@) if $@; } -sub net_merge_done1 { # bump merge-count in top-level lei-daemon - my ($wq) = @_; - return if ++$wq->{nr_net_merge_done} != $wq->{-wq_nr_workers}; - $wq->net_merge_all_done; # defined per wq-class (e.g. LeiImport) -} - sub net_merge_all { # called in wq worker via wq_broadcast my ($wq, $net_new) = @_; my $net = $wq->{lei}->{net}; %$net = (%$net, %$net_new); - # notify daemon we're ready - $wq->{lei}->{pkt_op_p}->pkt_do('net_merge_done1') or - die "pkt_op_do net_merge_done1: $!"; } # called by top-level lei-daemon when first worker is done with auth sub net_merge_continue { my ($wq, $net_new) = @_; $wq->wq_broadcast('net_merge_all', $net_new); # pass to current workers + $wq->net_merge_all_done; # defined per-WQ } sub op_merge { # prepares PktOp->pair ops my ($self, $ops, $wq) = @_; $ops->{net_merge_continue} = [ \&net_merge_continue, $wq ]; - $ops->{net_merge_done1} = [ \&net_merge_done1, $wq ]; } sub new { bless \(my $x), __PACKAGE__ } |