From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 861681F4B4; Mon, 18 Jan 2021 21:19:54 +0000 (UTC) Date: Mon, 18 Jan 2021 21:19:54 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Re: [PATCH 1/2] lei q: parallelize Maildir and mbox writing Message-ID: <20210118211954.GA28437@dcvr> References: <20210118103032.1430-1-e@80x24.org> <20210118103032.1430-2-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210118103032.1430-2-e@80x24.org> List-Id: Eric Wong wrote: > diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm > @@ -14,6 +15,8 @@ use Symbol qw(gensym); > use IO::Handle; # ->autoflush > use Fcntl qw(SEEK_SET SEEK_END O_CREAT O_EXCL O_WRONLY); > use Errno qw(EEXIST ESPIPE ENOENT); > +use File::Temp 0.19 (); # 0.19 for ->newdir File::Temp is unnecessary, will squash this in: diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm index 17d48a90..8d030227 100644 --- a/lib/PublicInbox/LeiToMail.pm +++ b/lib/PublicInbox/LeiToMail.pm @@ -15,7 +15,6 @@ use Symbol qw(gensym); use IO::Handle; # ->autoflush use Fcntl qw(SEEK_SET SEEK_END O_CREAT O_EXCL O_WRONLY); use Errno qw(EEXIST ESPIPE ENOENT); -use File::Temp 0.19 (); # 0.19 for ->newdir use PublicInbox::Git; my %kw2char = ( # Maildir characters My initial attempt at making this change didn't have the {each_smsg_done} pipe performing keepalive. Instead it created another tmpdir copy of the tmpdir created by LeiXSearch->git. That was ugly and didn't work, since it was possible for for the original LeiXSearch->git tmpdir to go out-of-scope before the lei2mail worker even got a chance to copy the bare directory and its alternates file. The {each_smsg_done} pipe is much nicer since the kernel can keep track of in-flight pipes and doesn't inflict extra FS activity.