[PATCH] search: fix rt: w/ approxidate when TZ != UTC

2021-09-16 Thread Eric Wong
While git respects a user's local timezone and returns seconds-since-the-Epoch, we were unnecessarily and incorrectly calling gmtime+strftime on its result. So ignore calling gmtime+strftime when the strftime format is "%s", just feed the output time from git directly to Xapian. This is mainly

Re: [PATCH] lei: sqlite: do not forcibly enable WAL

2021-09-16 Thread Eric Wong
Eric Wong wrote: > It could be a problem with my ancient SSD, improper use on our > end, Yes, EDOOFUS :x I suspect it was fixed in v2 of <20210917015644.32746-...@80x24.org> ("lei refresh-mail-sync: replace prune-mail-sync") So I think lei will keep using WAL (and maybe start using mmap, too)

[PATCH v2 5/6] lei refresh-mail-sync: implicitly remove missing folders

2021-09-16 Thread Eric Wong
There's no point in keeping mail_sync.sqlite3 entries around if the folder is gone. We do keep saved-search configs around, however, since somebody may decide to blow away a search and start over. --- lib/PublicInbox/LeiInput.pm | 11 ++- lib/PublicInbox/LeiRefreshMailSync.pm |

[PATCH v2 6/6] lei refresh-mail-sync: drop old IMAP folder info

2021-09-16 Thread Eric Wong
Like with Maildir, IMAP folders can be deleted entirely. Ensure they can be eliminated, but don't be fooled into removing them if they're temporarily unreachable. --- lib/PublicInbox/LeiRefreshMailSync.pm | 11 +++-- t/lei-refresh-mail-sync.t | 60 +++ 2 files

[PATCH v2 4/6] lei refresh-mail-sync: drop unused {verify} code path

2021-09-16 Thread Eric Wong
That option was never wired up, and probably not needed... --- lib/PublicInbox/LeiRefreshMailSync.pm | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/PublicInbox/LeiRefreshMailSync.pm b/lib/PublicInbox/LeiRefreshMailSync.pm index 71fc348c..4cae1536 100644

[PATCH v2 3/6] lei refresh-mail-sync: remove "gone" notices

2021-09-16 Thread Eric Wong
Those stderr messages are not useful at all, and harmful with the noise they cause. --- lib/PublicInbox/LeiRefreshMailSync.pm | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/PublicInbox/LeiRefreshMailSync.pm b/lib/PublicInbox/LeiRefreshMailSync.pm index 3c083965..71fc348c 100644 ---

[PATCH v2 2/6] lei_mail_sync: don't hold statement handle into callback

2021-09-16 Thread Eric Wong
This can cause readers and writers to conflict since the implicit transaction from SELECT in a LeiRefreshMailSync worker would block the LeiStore process. --- lib/PublicInbox/LeiMailSync.pm | 41 ++ 1 file changed, 32 insertions(+), 9 deletions(-) diff --git

[PATCH v2 1/6] lei refresh-mail-sync: replace prune-mail-sync

2021-09-16 Thread Eric Wong
Merely pruning mail synchronization information was insufficient for Maildir: renames are common in Maildir and we need to detect them after-the-fact when lei-daemon isn't running. Running this command could make "lei index" far more useful... v2: close R/O mail_sync.sqlite3 dbh before fork

[PATCH v2 0/6] lei refresh-mail-sync: another try...

2021-09-16 Thread Eric Wong
OK, so a bunch of things were broken/annoying in my initial patch @ <20210916094116.11457-...@80x24.org> 2/6 was only exposed in real-world usage with giant folders; and a testcase is still pending for that... Eric Wong (6): lei refresh-mail-sync: replace prune-mail-sync lei_mail_sync: don't

Re: lei import on epochs [was: make menuconfig interface for lei / grok-pull]

2021-09-16 Thread Luis Chamberlain
On Thu, Sep 16, 2021 at 5:22 PM Eric Wong wrote: > Since epochs expose the gittyness of lei, perhaps a limited form > of commitish-like ranges used by git would work: > > lei add-external --mirror $URL --epoch=0..9 > lei add-external --mirror $URL --epoch=5.. > lei add-external --mirror

Re: lei import on epochs [was: make menuconfig interface for lei / grok-pull]

2021-09-16 Thread Eric Wong
Luis Chamberlain wrote: > On Thu, Sep 16, 2021 at 09:09:02PM +, Eric Wong wrote: > > Luis Chamberlain wrote: > > > # The next two don't work > > > lei import import https://lore.kernel.org/linux-fsdevel/git/0.git > > > > Btw, extra "import" aside; I never intended to support the above > >

Re: make menuconfig interface for lei / grok-pull

2021-09-16 Thread Luis Chamberlain
On Thu, Sep 16, 2021 at 01:38:32PM -0400, Konstantin Ryabitsev wrote: > On Wed, Sep 15, 2021 at 02:34:40PM -0700, Luis Chamberlain wrote: > > My use case is I'm subscribed to a few kernel mailign lists and I use > > mutt with Maildir. I had configured recently pi-piper and grokmirror > > so that I

Re: lei import on epochs [was: make menuconfig interface for lei / grok-pull]

2021-09-16 Thread Luis Chamberlain
On Thu, Sep 16, 2021 at 09:09:02PM +, Eric Wong wrote: > Luis Chamberlain wrote: > > # The next two don't work > > lei import import https://lore.kernel.org/linux-fsdevel/git/0.git > > Btw, extra "import" aside; I never intended to support the above > case. However, your post got me

lei import on epochs [was: make menuconfig interface for lei / grok-pull]

2021-09-16 Thread Eric Wong
Luis Chamberlain wrote: > # The next two don't work > lei import import https://lore.kernel.org/linux-fsdevel/git/0.git Btw, extra "import" aside; I never intended to support the above case. However, your post got me thinking we could and probably should... :> (epochs are git storage with a

[PATCH] doc: glossary: add a reference for "epoch"

2021-09-16 Thread Eric Wong
It comes up often enough and we need to ensure it's not confused with IMAP "slices". --- Documentation/public-inbox-glossary.pod | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/public-inbox-glossary.pod b/Documentation/public-inbox-glossary.pod index f17f2d28..710098c8

Re: mbox support in other software

2021-09-16 Thread Eric Wong
Konstantin Ryabitsev wrote: > On Thu, Sep 16, 2021 at 07:34:37AM +, Eric Wong wrote: > > git supports mboxo and mboxrd, nowadays; but it seems like most > > other software only know how to deal with one of the mbox family > > (and mixing software on the same mbox leads to bad things). > >

[PATCH] lei_pmdir: do not attempt to trigger network auth

2021-09-16 Thread Eric Wong
Since some commands access both Maildirs and IMAP/NNTP servers at the same time, LeiPmdir may see the same lei->{auth} and lei->{net} objects as the sibling LeiInput-based workers. Delete those at fork and do not attempt to do authentication in those cases, since "net_merge_continue" will not be a

IMAP vs NNTP [was: make menuconfig interface for lei / grok-pull]

2021-09-16 Thread Eric Wong
Konstantin Ryabitsev wrote: > On Wed, Sep 15, 2021 at 11:06:05PM +, Eric Wong wrote: > > Does lore.kernel.org run public-inbox-imapd? > > I'm still not convinced it's useful for huge collections, especially > considering how chatty IMAP is. Is there any benefit to enable it for lei use? lei

Re: make menuconfig interface for lei / grok-pull

2021-09-16 Thread Konstantin Ryabitsev
On Wed, Sep 15, 2021 at 11:06:05PM +, Eric Wong wrote: > Does lore.kernel.org run public-inbox-imapd? I'm still not convinced it's useful for huge collections, especially considering how chatty IMAP is. Is there any benefit to enable it for lei use? -K

Re: make menuconfig interface for lei / grok-pull

2021-09-16 Thread Konstantin Ryabitsev
On Wed, Sep 15, 2021 at 02:34:40PM -0700, Luis Chamberlain wrote: > My use case is I'm subscribed to a few kernel mailign lists and I use > mutt with Maildir. I had configured recently pi-piper and grokmirror > so that I get only the last 1 year of email from a few set of mailing > lists. For this

Re: mbox support in other software

2021-09-16 Thread Konstantin Ryabitsev
On Thu, Sep 16, 2021 at 07:34:37AM +, Eric Wong wrote: > Since I've written the lei-mail-formats manpage, I've been > curious what other software differentiates between the various > mbox formats and supports several/all of them? > > AFAIK, none of the Perl Mail::* stuff does, nor does

[PATCH] lei: sqlite: do not forcibly enable WAL

2021-09-16 Thread Eric Wong
I'm not sure why and I can no longer reproduce it; but I've triggered a SIGBUS in the lei/store inside the WAL commit code while writing to mail_sync.sqlite3 on my Debian (oldstable) buster system. It could be a problem with my ancient SSD, improper use on our end, a bug fixed in a newer SQLite

[SQUASH] fix manifest

2021-09-16 Thread Eric Wong
Ugh... (mainly posting this trivial patch for SolverGit :P). --- MANIFEST | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index 221cb992..9f11f2f9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -235,7 +235,6 @@ lib/PublicInbox/LeiNoteEvent.pm lib/PublicInbox/LeiOverview.pm

[PATCH 1/3] lei: git_oid: replace git_blob_id

2021-09-16 Thread Eric Wong
We'll be using binary SHA-1 and SHA-256 in-memory since that's what mail_sync.sqlite3 stores. --- lib/PublicInbox/LEI.pm| 10 +++--- lib/PublicInbox/LeiInspect.pm | 3 ++- lib/PublicInbox/LeiRemote.pm | 2 +- lib/PublicInbox/LeiStore.pm | 9 +

[PATCH 2/3] lei refresh-mail-sync: replace prune-mail-sync

2021-09-16 Thread Eric Wong
Merely pruning mail synchronization information was insufficient for Maildir: renames are common in Maildir and we need to detect them after-the-fact when lei-daemon isn't running. Running this command could make "lei index" far more useful... --- MANIFEST |

[PATCH 3/3] net_reader: load IO::Socket::Socks in all workers

2021-09-16 Thread Eric Wong
This was previously undetected since SOCKS is mainly used for read-only (single worker) tasks, and worker[0] always loaded the module. However, "lei refresh-mail-sync" can bounce reads to any worker, so we need to ensure worker[1..Inf] load it, too. --- lib/PublicInbox/NetReader.pm | 5 + 1

[PATCH 0/3] lei refresh-mail-sync

2021-09-16 Thread Eric Wong
The command I need because lei-daemon keeps dying so inotify ain't useful :P Well, actually, I just restart lei-daemon frequently because I'm always changing code. 1/3 is a nice cleanup, 2/3 makes the change AFAIK, refresh-mail-sync (and prune-mail-sync before it) were the only which could

[PATCH] doc: lei-mail-formats: add "eml" and expand on git things

2021-09-16 Thread Eric Wong
While "eml" is not an output format, it seems worthy to document, here, since users are likely to have experience with *.patch files from "git format-patch". --- Documentation/lei-mail-formats.pod | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git

mbox support in other software

2021-09-16 Thread Eric Wong
Since I've written the lei-mail-formats manpage, I've been curious what other software differentiates between the various mbox formats and supports several/all of them? AFAIK, none of the Perl Mail::* stuff does, nor does Email::Folder (AFAIK abandoned). I haven't looked at libraries for Python