From 7e4bd71efcf3bf61216ec1a7577e33be5f95b8a9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 21 Apr 2022 11:59:06 +0000 Subject: lei: commit store on interrupted partial imports 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. --- lib/PublicInbox/LeiImportKw.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/PublicInbox/LeiImportKw.pm') diff --git a/lib/PublicInbox/LeiImportKw.pm b/lib/PublicInbox/LeiImportKw.pm index 52fd4043..4dd938f5 100644 --- a/lib/PublicInbox/LeiImportKw.pm +++ b/lib/PublicInbox/LeiImportKw.pm @@ -47,9 +47,7 @@ sub ck_update_kw { # via wq_io_do } sub _lei_wq_eof { # EOF callback for main lei daemon - my ($lei) = @_; - my $ikw = delete $lei->{ikw} or return $lei->fail; - $lei->sto_done_request($ikw->{lei_sock}); + $_[0]->wq_eof('ikw'); } 1; -- cgit v1.2.3-24-ge0c7