diff options
author | Eric Wong <e@80x24.org> | 2022-04-21 11:59:06 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-04-22 03:05:56 +0000 |
commit | 7e4bd71efcf3bf61216ec1a7577e33be5f95b8a9 (patch) | |
tree | 25569363d09dd1d047a2e8e158c1a5ccfd1a9e1d /lib/PublicInbox/LeiPmdir.pm | |
parent | d362af89d8019ff12d3550c83de2c3aa5d9f095b (diff) | |
download | public-inbox-7e4bd71efcf3bf61216ec1a7577e33be5f95b8a9.tar.gz |
This change prevents lingering shard and git-fast-import processes from remaining after interrupted "lei import" (and similar). It also reduces the likelyhood of data-loss in case of subsequent abnormal termination of the daemon. I think this is the least surprising way to handle users prematurely aborting imports or other similar operations which write to lei/store and will result in reduced bandwidth waste for users with intermittent connections. This is because the lei/store processes may be shared by parallel "lei import" callers, and commits done by any "lei import" caller will inevitably trigger writes for all of them.
Diffstat (limited to 'lib/PublicInbox/LeiPmdir.pm')
-rw-r--r-- | lib/PublicInbox/LeiPmdir.pm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/PublicInbox/LeiPmdir.pm b/lib/PublicInbox/LeiPmdir.pm index f9b68fc2..d4aa0212 100644 --- a/lib/PublicInbox/LeiPmdir.pm +++ b/lib/PublicInbox/LeiPmdir.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # WQ worker for dealing with parallel Maildir reads; @@ -48,9 +48,7 @@ sub mdir_iter { # via wq_io_do } sub _lei_wq_eof { # EOF callback for main lei daemon - my ($lei) = @_; - my $pmd = delete $lei->{pmd} or return $lei->fail; - $lei->sto_done_request($pmd->{lei_sock}); + $_[0]->wq_eof('pmd'); } 1; |