From: Jacob Bachmeyer Date: Fri, 4 Aug 2023 22:17:56 +0000 (-0500) Subject: Ensure key index is ready before processing first packet X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6d69ba64f289dba700778fe4df2146ef5d7dbb2e;p=gatekeeper.git Ensure key index is ready before processing first packet The key index is never detached, so all packets after the first were always processed with the index lock held. Further, the index is needed to send a report, so ensuring that it is available before processing the first packet avoids a potential lost report if it cannot be attached. --- diff --git a/gatekeeper.pl b/gatekeeper.pl index cceb210..79db0d9 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -3367,6 +3367,9 @@ my @packets; @packets = gather_packets(CONF_DIR_Inbox, CONF_DIR_Scratch); } +# sending a report uses the key index +keyidx_attach if @packets; + foreach my $packet (@packets) { eval { # trap exceptions encountered while processing a packet local $Phase = 'PS'; @@ -3383,9 +3386,6 @@ foreach my $packet (@packets) { $packet->install; }; - # sending a report uses the key index - keyidx_attach; - if ($packet->successful) { local $Phase = 'RP';