Eric Wong [Sat, 19 Sep 2020 09:37:10 +0000 (09:37 +0000)]
add gcf2 client and executable script
This should be able to replace multiple `git cat-file' for blob
retrieval, but adjustments may be needed.
Eric Wong [Sat, 19 Sep 2020 09:37:09 +0000 (09:37 +0000)]
t/gcf2: test changes to alternates
Calling ->add_alternate won't pick up new additions to
$OBJDIR/info/alternates, unfornately. Thus v2 inboxes will
need to do something to invalidate Gcf2 objects.
Eric Wong [Sat, 19 Sep 2020 09:37:08 +0000 (09:37 +0000)]
gcf2: libgit2-based git cat-file alternative
Having tens of thousands of inboxes and associated git processes
won't work well, so we'll use libgit2 to access the object DB
directly. We only care about OID lookups and won't need to rely
on per-repo revision names or paths.
The Git::Raw XS package won't be used since its manpages don't
promise a stable API. Since we already use Inline::C and have
experience with I::C when it comes to compatibility, this only
introduces libgit2 itself as a source of new incompatibilities.
This also provides an excuse for me to writev(2) to reduce
syscalls, but liburing is on the horizon for next year.
Eric Wong [Thu, 17 Sep 2020 08:57:51 +0000 (08:57 +0000)]
git_async_cat: inline + drop redundant batch_prepare call
$git->cat_async already calls $git->batch_prepare iff needed, so
we can reduce subroutine calls and inline a one-off subroutine
to save some memory, here.
Eric Wong [Thu, 17 Sep 2020 21:25:22 +0000 (21:25 +0000)]
doc: txt2pre: more manpage URLs
We host our own -imapd manpage, and we started using a few more
git commands (fast-import for ages). We'll also need to link to
manpages.debian.org and live with long URLs for a few
non-standard manpages in software we reference.
Eric Wong [Thu, 17 Sep 2020 21:25:21 +0000 (21:25 +0000)]
doc: flow: include -imapd
It's another read-only daemon, and it may see more usage than
-nntpd as more users have IMAP support than NNTP.
Eric Wong [Wed, 16 Sep 2020 22:17:08 +0000 (22:17 +0000)]
t/indexlevels-mirror: fix improperly skipped test
Oops :x
Eric Wong [Wed, 16 Sep 2020 20:02:20 +0000 (20:02 +0000)]
public-inbox 1.6.0
Eric Wong [Wed, 16 Sep 2020 07:18:53 +0000 (07:18 +0000)]
git_async_cat: fix outdated comment
We replaced Danga::Socket with PublicInbox::DS roughly a year
before GitAsyncCat was introduced into our git history.
Eric Wong [Tue, 15 Sep 2020 19:48:50 +0000 (19:48 +0000)]
wwwtext: link to public-inbox.org/meta archives
Since we're advertising our address at meta@public-inbox.org,
we should advertise the archives, too.
Eric Wong [Tue, 15 Sep 2020 20:15:24 +0000 (20:15 +0000)]
wwwstream: link to cgit URLs for coderepo
Hopefully this reduces the ambiguity between code for the
project(s) using public-inbox and the code for public-inbox
itself.
Eric Wong [Tue, 15 Sep 2020 19:51:37 +0000 (19:51 +0000)]
treewide: relax allow >=40 chars for git OID
This will help with eventual git SHA-256 transitions.
Eric Wong [Tue, 15 Sep 2020 19:51:36 +0000 (19:51 +0000)]
mid: rename MID_MAX to ID_MAX
It's only used for HTML anchors which we will need indefinitely.
Eric Wong [Tue, 15 Sep 2020 06:11:18 +0000 (06:11 +0000)]
imap: quiet uninitialized variable warning on FETCH
This was triggered by blindly trying to FETCH an MSN (not
"UID FETCH") on an empty dummy inbox. It's harmless, and
probably triggered by a wayward client or misbehaving bot.
Eric Wong [Mon, 14 Sep 2020 22:02:23 +0000 (22:02 +0000)]
ci/deps: add Plack::Test::ExternalServer for devtest
More of our Plack tests exercise public-inbox-httpd, nowadays;
and ExternalServer lets us test it easily alongside generic PSGI
stuff.
Eric Wong [Mon, 14 Sep 2020 21:29:40 +0000 (21:29 +0000)]
t/imapd.t: skip dependent test on failure
We don't want to cascade failures/warnings when something else
breaks. There's likely more of these to be fixed as we
encounter them.
Eric Wong [Mon, 14 Sep 2020 06:39:36 +0000 (06:39 +0000)]
doc: TODO and release notes updates ahead of 1.6
Some more things have happened...
And drop some items which are too expensive to support,
such as automatic mirroring.
Eric Wong [Mon, 14 Sep 2020 06:29:26 +0000 (06:29 +0000)]
tests: consistently check for xapian-compact
We may need to test against development versions of Xapian,
which may rely on setting `XAPIAN_COMPACT=xapian-compact-1.5'.
Ensure it's possible to do that.
And add a missing check in t/xcpdb-reshard.t, too.
Eric Wong [Mon, 14 Sep 2020 03:42:30 +0000 (03:42 +0000)]
sigfd: fix typos and scoping on systems w/o epoll+kqueue
Unfortunately, I'm not sure how easy catching these at
compile-time, is. Prototypes do not seem to check these
at compile time when crossing packages (not even with
exported subroutines).
Kyle Meyer [Sun, 13 Sep 2020 19:31:55 +0000 (15:31 -0400)]
doc: Add piem to list of clients
Eric Wong [Fri, 11 Sep 2020 07:32:33 +0000 (07:32 +0000)]
nntp: share more code between art_lookup callers
This prepares us for future changes to improve scalability to
many inboxes.
Eric Wong [Fri, 11 Sep 2020 07:32:32 +0000 (07:32 +0000)]
t/nntpd: add test for the XPATH command
It's only in RFC 2980 (not 977 or 3977), but Net::NNTP has
supported it since 2001, at least. We'll be making changes
to avoid pathological behavior, so test it, first.
Eric Wong [Fri, 11 Sep 2020 07:32:31 +0000 (07:32 +0000)]
treewide: avoid `goto &NAME' for tail recursion
While Perl implements tail recursion via `goto' which allows
avoiding warnings on deep recursion. It doesn't (as of 5.28)
optimize the speed of such dispatches, though it may reduce
ephemeral memory usage.
Make the code less alien to hackers coming from other languages
by using normal subroutine dispatch. It's actually slightly
faster in micro benchmarks due to the complexity of `goto &NAME'.
Eric Wong [Thu, 10 Sep 2020 05:46:04 +0000 (05:46 +0000)]
wwwstream: show init + index instructions for -V1, too
This should've always been there. I'm not sure how widely
spread 1.0 and earlier releases were, but we'll keep documenting
the version requirement.
Eric Wong [Thu, 10 Sep 2020 01:51:53 +0000 (01:51 +0000)]
solver: async blob retrieval for diff extraction
Like the rest of the WWW code, public-inbox-httpd now uses
git_async_cat to retrieve blobs without blocking the event loop.
This improves fairness when git blobs are on slow storage and
allows us to take better advantage of SMP systems.
Eric Wong [Wed, 9 Sep 2020 06:26:18 +0000 (06:26 +0000)]
solver: break apart inbox blob retrieval
To avoid hogging the event loop in public-inbox-httpd when
many candidate messages match, we'll separate the steps to
ensure fairness on slow storage.
Eric Wong [Wed, 9 Sep 2020 06:26:17 +0000 (06:26 +0000)]
solver: check one git coderepo and inbox at a time
With public-inbox-httpd, this mitigates the effect of slow git
blob storage with multiple coderepos configured for an inbox.
It's still synchronous for now (and may need to remain that way
for ->last_check_err), but no longer monopolizes the event loop
when checking multiple coderepos.
We don't yet support multi-inbox scanning, yet; but this also
prepares us for a future where we do.
We'll also support >=40 char blob OIDs in preparation for future
git SHA-256 support, too.
Eric Wong [Wed, 9 Sep 2020 06:26:16 +0000 (06:26 +0000)]
wwwlisting: avoid hogging event loop
By using the just-introduced ConfigIter class.
And make ManifestJsGz a subclass of it to reduce duplication.
Eric Wong [Wed, 9 Sep 2020 06:26:15 +0000 (06:26 +0000)]
extmsg: prevent cross-inbox matches from hogging event loop
With many inboxes, checking multiple SQLite repos will be slow
and time-consuming, so ensure we can schedule it fairly between
multiple inboxes.
Eric Wong [Wed, 9 Sep 2020 06:26:14 +0000 (06:26 +0000)]
t/cgi.t: show stderr on failures
This helped me diagnose an error I would've introduced
in the next commit.
Eric Wong [Wed, 9 Sep 2020 06:26:13 +0000 (06:26 +0000)]
config: split out iterator into separate object
We will need to allow simultaneous iterators on the same
config object, since we'll need this for ExtMsg, NNTPD,
WwwListing, NewsWWW, and other places.
Eric Wong [Wed, 9 Sep 2020 06:26:12 +0000 (06:26 +0000)]
config: flatten each_inbox and iterate_start args
In Perl, we can simplify callers by passing a single array
all the way down the stack instead of a single array ref which
needs to be expanded every call.
Eric Wong [Wed, 9 Sep 2020 06:26:11 +0000 (06:26 +0000)]
www: manifest.js.gz generation no longer hogs event loop
It's still as slow as before with hundreds/thousands of inboxes,
but at least it's fair. Future changes will allow it to be
cached and memoized with persistent HTTP servers.
Eric Wong [Wed, 9 Sep 2020 06:26:10 +0000 (06:26 +0000)]
use "\&" where possible when referring to subroutines
"*foo" is ambiguous in that it may refer to a bareword file handle;
so we'll use it where we can without triggering warnings.
PublicInbox::TestCommon::run_script_exit required dropping the
prototype, however. We'll also future-proof by dropping "use
warnings" in Cgit.pm and use the less-ambiguous "//=" in Inbox.pm
while we're in the area.
Eric Wong [Wed, 9 Sep 2020 06:26:09 +0000 (06:26 +0000)]
solver: drop warnings, modernize use v5.10.1, use SEEK_SET
With Perl upstream preparing to deprecate things, we'll move
towards only enabling warnings during development via shebang
and stop enabling them via "use".
We'll also favor "use v5.10.1" over the Perl 5.6-compatible "use
5.010_001", since our code base never worked on 5.6.
Finally, were also importing SEEK_SET without using it, just use it
for readability since we can't avoid loading Fcntl in other
places and it'll get constant-folded, anyways.
Eric Wong [Wed, 9 Sep 2020 06:26:08 +0000 (06:26 +0000)]
xt/solver: test with public-inbox-httpd, too
We'll be making changes to solver to make it even fairer
to slow clients on slow storage. Ensure we test with
public-inbox-httpd-specific codepaths, since the generic
PSGI code paths are rare in production use.
Eric Wong [Wed, 9 Sep 2020 21:23:26 +0000 (21:23 +0000)]
wwwtext: config comment improvements
Use the full URL of the inbox being mirrored to reduce ambiguity
(instead of just the inbox name).
Using asymmetric quotes (e.g `foo') improves readability for me
in that it's more obvious when a quote begins and ends. It also
lights up fewer pixels and reduces visual noise compared to
double-quotes.
We'll also reflow the `mainrepo' vs `inboxdir' comment slightly
to emphasize the word `instead'.
Eric Wong [Wed, 9 Sep 2020 21:23:25 +0000 (21:23 +0000)]
wwwtext: don't blindly quote "git clone" destination
Save screen space and light up fewer pixels to reduce visual noise.
Eric Wong [Wed, 9 Sep 2020 21:23:24 +0000 (21:23 +0000)]
wwwtext: describe the use of `coderepo' entries
The `solver' feature is not very obvious, give potential
users a hint about it.
Eric Wong [Thu, 10 Sep 2020 09:38:39 +0000 (09:38 +0000)]
nntp: fix cross-newsgroup Message-ID lookups
We cannot blindly use the selected newsgroup for
HEAD/ARTICLE/BODY requests using Message-ID, since
those commands look across all newsgroups; not just
the selected one (if any).
So stuff a reference to the Inbox object into $smsg.
We can reduce args passed into set_nntp_headers() and
msg_hdr_write(), too.
Fixes: 0e6ceff37fc38f28 ("nntp: support slow blob retrievals")
Eric Wong [Wed, 9 Sep 2020 21:38:17 +0000 (21:38 +0000)]
wwwstream: fix "Atom feed" link
Oops, I wanted to stop escaping double-quotes with `qq()' but
used `q()' instead :x
Fixes: 2f61828fcb727e51 ("www: make mirror instructions more prominent")
Eric Wong [Wed, 9 Sep 2020 20:24:55 +0000 (20:24 +0000)]
contrib/css: limit <a> coloring to links, only
We don't want <a> tags without href= attributes to be colored,
since the `<a id=mirror>' tag in the HTML footer is intended
as an anchor destination for `<a href=#mirror>' link at the
top.
Eric Wong [Tue, 8 Sep 2020 08:29:14 +0000 (08:29 +0000)]
www: make mirror instructions more prominent
In order to fight the misconception that public-inboxes are
centralized, anchor "#mirror" to the clone instructions and
place an emphasis on "mirror", not just cloning.
While we're at it, better describe multi-epoch -V2 inboxes,
since some users do not seem to realize epochs consist of
different data.
Eric Wong [Wed, 2 Sep 2020 11:04:21 +0000 (11:04 +0000)]
v2writable: reuse read-only shard counting code
We'll also fix the read-only code to ensure we notice missing
Xapian shards, since gaps would throw off our expectation that
Xapian document IDs and NNTP article numbers are interchangeable.
Eric Wong [Wed, 2 Sep 2020 11:04:20 +0000 (11:04 +0000)]
overidx: document column uses
This may be useful for keeping our heads on straight dealing
with IMAP, NNTP, JMAP, etc.
Eric Wong [Wed, 2 Sep 2020 11:04:19 +0000 (11:04 +0000)]
wwwaltid: drop unused sqlite3_missing function
It's inlined into the main function, which we'll shorten
slightly with the defined-or (`//') operator. Also noticed
and fixed a mismatched HTML tag.
Eric Wong [Wed, 2 Sep 2020 11:04:18 +0000 (11:04 +0000)]
imap: drop old, pre-Parse::RecDescent search parser
We switched to Parse::RecDescent during development and left
some dead code behind.
Eric Wong [Wed, 2 Sep 2020 11:04:17 +0000 (11:04 +0000)]
search: remove {over_ro} field
Only inbox accesses the read-only {over}, now, instead of going
through ->search. This simplifies our object graph and avoids
potentially redundant FDs and DB handles pointing to the same
over.sqlite3 file.
Eric Wong [Wed, 2 Sep 2020 11:04:16 +0000 (11:04 +0000)]
search: replace ->query with ->mset
Nearly all of the search uses in the production code rely on
a Xapian mset iterator being returned (instead of an array
of $smsg objects). So default to returning the mset and move
the burden of smsg array conversion into the test cases.
Eric Wong [Wed, 2 Sep 2020 11:04:15 +0000 (11:04 +0000)]
tests: add "use strict" and declare v5.10.1 compatibility
strict.pm helped me find a typo in an upcoming recent change, so
ensure we use it since it does more good than harm. We'll also
take the opportunity here to declare v5.10.1 compatibility level
to future-proof against Perl incompatibilities.
Eric Wong [Wed, 2 Sep 2020 11:04:14 +0000 (11:04 +0000)]
search: remove special case for blank query
The special case (if any) belongs at a higher-level,
and this is another step towards removing {over_ro}-dependence
in our Search object.
Eric Wong [Wed, 2 Sep 2020 11:04:13 +0000 (11:04 +0000)]
use more idiomatic internal API for ->over access
{over_ro} being a part of the Search object is a historical
oddity which will go away, soon. Lets start removing its use in
tests and rarely-used helper scripts.
Eric Wong [Wed, 2 Sep 2020 11:04:12 +0000 (11:04 +0000)]
disambiguate OverIdx and Over by field name
We'll use {oidx} as the common field name for the read-write
OverIdx, here, to disambiguate it from the read-only {over}
field. This hopefully makes it clearer which code paths are
read-only and which are read-write.
Eric Wong [Wed, 2 Sep 2020 11:04:11 +0000 (11:04 +0000)]
msgmap: note how we use ->created_at
It'll likely be used in the future for JMAP, detached indices,
and maybe other things.
Eric Wong [Mon, 31 Aug 2020 23:41:56 +0000 (23:41 +0000)]
t/run: Perl future proofing
Bareword file handles outside of STD(IN|OUT|ERR) seem to be on
the chopping block for Perl 8. We'll also "use v5.10.1" to
guard against future incompatibilities.
Eric Wong [Tue, 1 Sep 2020 01:15:07 +0000 (01:15 +0000)]
init+convert: create non-existing directory hierarchies
Following "git init" as an example, we'll create every parent
path up to the one specified, instead of attempting to continue
on when Cwd::abs_path returns `undef'.
Eric Wong [Tue, 1 Sep 2020 01:15:06 +0000 (01:15 +0000)]
doc: remove B<> (bold) markup from the remaining POD
B<> decreases readability of the POD source and is of dubious
usefulness in the man page.
Eric Wong [Tue, 1 Sep 2020 01:15:05 +0000 (01:15 +0000)]
watch: add --help/-h support
And avoid unnecessary POD markup in the man page.
Eric Wong [Tue, 1 Sep 2020 01:15:04 +0000 (01:15 +0000)]
config: use defined-or (//) in a few places
Just some golfing to reduce scrolling and hopefully readability.
Eric Wong [Tue, 1 Sep 2020 01:15:03 +0000 (01:15 +0000)]
mda+learn: add --help / -h support
"use Getopt::Long" doesn't seem too slow on a hot page cache,
and it's probably used frequently enough to be in cache.
We'll also start reducing the amount of markup in the .pod and
favoring verbatim text in documentation for readability in
source form, since the bold text seems excessive.
Eric Wong [Tue, 1 Sep 2020 01:15:02 +0000 (01:15 +0000)]
daemon: support --help/-h in -httpd/imapd/nntpd
For consistency with other commands, though the
protocol-specific options should refer users to
the manpage.
Eric Wong [Tue, 1 Sep 2020 01:15:01 +0000 (01:15 +0000)]
script/*: fold $usage into $help, support `-h' instead of -?
`-h' doesn't conflict with anything, and some users (including
git users) may be more accustomed to using it rather than the
rarely-seen-outside-of-Getopt::Long `-?' switch.
We can also rely on the GetOptions() function to emit a proper
error message instead of just "bad command-line args".
Eric Wong [Tue, 1 Sep 2020 01:15:00 +0000 (01:15 +0000)]
edit+purge: support `--help' and `-h' like other commands
And while we're at it, note edit is *destructive* to encourage
reading the fine manual.
Eric Wong [Tue, 1 Sep 2020 01:14:59 +0000 (01:14 +0000)]
admin: improve minimum version text
"inboxes 1 inboxes not supported by ..." was non-sensical.
Now it'll show "-V1 inbox not supported by ...", instead.
Eric Wong [Tue, 1 Sep 2020 01:14:58 +0000 (01:14 +0000)]
script/*: set executable bit on -learn and -imapd
It's useful to mark they're meant to be executable, even
if the shebang is useless.
Eric Wong [Tue, 1 Sep 2020 05:55:45 +0000 (05:55 +0000)]
t/v2dupindex: test indexing mirrors with duplicate messages
While it's not a known problem, our deduplicating logic may
change in the future; or a BOFH could be manually injecting
duplicate messages directly into the git epoch repositories.
Ensure indexing in mirrors doesn't break when there's
duplicates. This is in preparation for detached indices
for multi-inbox search.
Eric Wong [Tue, 1 Sep 2020 16:54:31 +0000 (16:54 +0000)]
index: check for xapian-compact when using --compact
Otherwise, users may be frustrated to discover it missing
a long indexing run.
Eric Wong [Mon, 31 Aug 2020 04:41:40 +0000 (04:41 +0000)]
replace ParentPipe with EOFpipe
ParentPipe was a subset of EOFpipe, except EOFpipe correctly
accounts for theoretical(*) spurious wakeups on the pipe.
(*) AFAIK, spurious wakeups are/were more likely on TCP sockets
due to checksum failures, something that's not a problem on
local pipes. We're also not sharing pipes like we do with
listen sockets on accept(2), so there's no chance of another
process grabbing bytes (unless we have bugs in our code).
Eric Wong [Mon, 31 Aug 2020 04:41:39 +0000 (04:41 +0000)]
ds: avoid unnecessary timer for waitpid
It doesn't seem necessary, since we won't call dwaitpid()
until we see an EOF.
Eric Wong [Mon, 31 Aug 2020 04:41:38 +0000 (04:41 +0000)]
watch: use EOFpipe to reduce dwaitpid wakeups
It's a bit inefficient to use a pipe, here. However, using
dwaitpid() on a process that's not expected to exit soon is
also inefficient as it causes excessive wakeups as most of
our inbox-writing code expects synchronous waitpid().
This only affects -watch instances configured for NNTP and IMAP
clients.
Eric Wong [Mon, 31 Aug 2020 04:41:37 +0000 (04:41 +0000)]
ds: avoid excessive queueing when reaping PIDs
We should not enqueue reap_pids() to run more than once per
EventLoop iteration. We'll start reformatting reap_pids
to tabs, too, since we're no longer Danga::Socket.
We should also be able to remove timer usage for reaping
down-the-line once we stop abusing dwaitpid() in -watch.
Eric Wong [Mon, 31 Aug 2020 04:41:36 +0000 (04:41 +0000)]
watch: comments and tiny cleanups
Get rid of an unused variable, prefix a warning and try to
better document control flow around various callbacks.
Eric Wong [Mon, 31 Aug 2020 04:41:35 +0000 (04:41 +0000)]
watch: block signals before fork on non-signalfd/kevent systems
In case there's non-Linux or BSD users w/o IO::KQueue, we
shouldn't let signal handlers fire in the child processes.
The child processes always assumed signals were blocked by
the parent, so no changes were necessary, there.
Eric Wong [Mon, 31 Aug 2020 04:41:34 +0000 (04:41 +0000)]
watch: avoid unnecessary spawning on spam removals
This should further mitigate lock contention problems
when -watch is configured to watch on a Maildir for spam
while performing a large NNTP import.
There is now a small risk a message won't get removed because if
it's in the current (uncommitted) fast-import batch, but
unlikely given the batch size is now only 10 messages.
If a that small window is hit, flipping the \Seen flag
(e.g. marking it unread, and then read again) will trigger
another removal attempt via IMAP or Maildir.
Eric Wong [Mon, 31 Aug 2020 04:41:33 +0000 (04:41 +0000)]
watch: log signal activities to STDERR
Sometimes it may not be apparent when/if a signal is
processed, this hopefully improves the situation.
We'll also change the process title when we're quitting
to better inform users.
Eric Wong [Mon, 31 Aug 2020 04:41:32 +0000 (04:41 +0000)]
rename WatchMaildir => Watch
This is no longer limited to Maildirs now that IMAP and NNTP
support exist; so give it a shorter name.
Eric Wong [Mon, 31 Aug 2020 04:41:31 +0000 (04:41 +0000)]
watchmaildir: use v5.10.1, drop warnings
Declare 5.10.1 to avoid potential compatibility problems with
Perl 7/8 down the line. We'll rely on the command-line to set
or drop warnings during development, at least.
Eric Wong [Mon, 31 Aug 2020 04:41:30 +0000 (04:41 +0000)]
watch: limit batch size of NNTP and IMAP workers, too
We don't want to monopolize locks because processes can easily
block each other if using `watchspam' on a Maildir while a big
NNTP or IMAP import is happening.
This can also happen if somebody configured a single inbox to
watch from several sources to merge several mailboxes into one
(e.g. both an IMAP and Maildir are watched).
Eric Wong [Mon, 31 Aug 2020 04:33:37 +0000 (04:33 +0000)]
doc: expand on indexBatchSize regarding fragmentation
And change the documentation reference in -tuning to
point to the -index manpage while we're at it.
Eric Wong [Sat, 29 Aug 2020 20:32:19 +0000 (20:32 +0000)]
imapd: filter out unusable flags from search
Quiet down logs from -imapd when clients are blindly
sending some unsupported flag conditions (e.g. "DRAFT",
"DELETED") specified in RFC 3501.
Eric Wong [Sat, 29 Aug 2020 03:48:39 +0000 (03:48 +0000)]
Eric Wong [Fri, 28 Aug 2020 10:13:00 +0000 (10:13 +0000)]
tests: check-run: show skipped tests
We'll deduplicate redundant lines and show counts of skipped
tests to ensure it's easy to notice if something is unexpectedly
skipped.
Eric Wong [Fri, 28 Aug 2020 10:12:59 +0000 (10:12 +0000)]
imaptracker: update_last: simplify callers
By making it a no-op if last_uid is not defined. This isn't a
hot code path, so the extra method dispatch isn't an issue.
It'll save some indentation/wrapping in future commits.
Eric Wong [Fri, 28 Aug 2020 10:12:58 +0000 (10:12 +0000)]
watch: flush changes to inbox before updating IMAPTracker
Data needs to hit inboxes, first. Otherwise it's possible to
skip messages in case git-fast-import is killed before it sees
"done\n". Now, -watch will just waste a little bandwidth in
re-downloading a seen message if it's interrupted immediately
before updating IMAPTracker.
Eric Wong [Fri, 28 Aug 2020 04:22:00 +0000 (04:22 +0000)]
Makefile.PL: run check-man for <= 80 columns on check-run, too
I mostly use "make check-run" instead of the slower "make check"
target, nowadays, so add this check to ensure the rendered
manpage is always be visible to more users who need big fonts.
Eric Wong [Thu, 27 Aug 2020 22:05:00 +0000 (22:05 +0000)]
www: more descriptive pagination
Being an easily confused person, I find "next" and "prev"
ambiguous as to whether messages on the next or previous page
will be newer or older than the current page. Clarify that for
the threaded /$INBOX/ view and search results.
For search results sorted by relevance, we'll use "[>= $SCORE]"
or "[<= $SCORE]" to indicate to indicate directionality.
This also fixes $INBOX/new.html for unindexed v1 inboxes.
Eric Wong [Thu, 27 Aug 2020 22:04:59 +0000 (22:04 +0000)]
www: improve navigation around contemporary threads
Sometimes it's useful to quickly get to threads and messages
which are contemporaries of the current thread/message being
focused on. This hopefully improves navigation by making:
a) the top line (where $INBOX_DIR/description) is shown
a link to the latest topics in search results and
per-thread/per-message views.
b) providing a link to contemporaries ("~YYYY-MM-DD") at
around the thread overview skeleton area for per-thread
and per-message views
Eric Wong [Thu, 27 Aug 2020 12:17:06 +0000 (12:17 +0000)]
doc: watch: expand on NNTP and IMAP-specific knobs
There's a few more, but maybe they're too esoteric
to be worth documenting at the moment (batch sizes, timeouts, etc).
Eric Wong [Thu, 27 Aug 2020 12:17:05 +0000 (12:17 +0000)]
doc: move watch config docs to -watch manpage
The -config manpage is a bit long and the -watch stuff is
isolated from the rest of it while we start documenting NNTP and
IMAP support.
I'm not entirely happy with the way IMAP and NNTP are
configured, it's still good enough for small setups.
This also fixes a long-standing misplaced comment about
`publicinboxwatch.spamcheck' affecting all configured inboxes,
that comment was actually for `publicinboxwatch.watchspam'.
We'll omit documenting NNTP for `watchspam', for now, given the
lack of \Seen flags in NNTP and I'm not sure if it's even
useful. There may not be any newsgroups for sharing confirmed
spam, either...
Eric Wong [Thu, 27 Aug 2020 12:17:04 +0000 (12:17 +0000)]
watch: imap: only remove \Seen spam
This matches the behavior of Maildir `watchspam' handling in not
removing unseen messages. NNTP can't match this behavior, since
NNTP servers don't store flags, clients do.
Eric Wong [Thu, 27 Aug 2020 12:17:03 +0000 (12:17 +0000)]
doc: speling fickses
Eric Wong [Thu, 27 Aug 2020 12:17:02 +0000 (12:17 +0000)]
doc: document graceful shutdown signals
Same as the read-only daemons.
Eric Wong [Thu, 27 Aug 2020 12:17:01 +0000 (12:17 +0000)]
overidx: inline create_ghost sub
There's no need for this to be a separate sub since there's
only a single caller. This saves a few kilobytes at least
in short-lived processes.
Eric Wong [Thu, 27 Aug 2020 12:17:00 +0000 (12:17 +0000)]
imaptracker: preserve WAL journal_mode if set by user
It's no problem for most users to enable WAL, here, since
there's only a single process doing both reading and writing
(unlike the read-only daemons). However, WAL doesn't work on
network filesystems, so it can't be enabled by default.
Eric Wong [Thu, 27 Aug 2020 12:16:59 +0000 (12:16 +0000)]
watchmaildir: ensure I:/W:/E: prefixes in warnings
For consistency in output, any URL/path-context-dependent
prefixes should have the same prefix as the actual warning which
triggered it.
Eric Wong [Thu, 27 Aug 2020 07:51:25 +0000 (07:51 +0000)]
git: show more context info on failures
I'm seeing "read: Connection timed out" from in my syslog from
-httpd. The fail() calls in PublicInbox::Git seems to be the
only code path of ours which could trigger it...
ETIMEDOUT shouldn't happen on pipes, only sockets; and all of
our socket operations are non-blocking. So this could be
cgit-wwwhighlight-filter.lua, but that's connecting over
localhost, though on fairly loaded HW.
Eric Wong [Wed, 26 Aug 2020 22:02:57 +0000 (22:02 +0000)]
search: allow testing with current xapian.git and 1.5.x
A `PI_XAPIAN' environment variable is now exposed for testing
purposes. We'll also deal with the removal of
`NumberValueRangeProcessor' and use `NumberRangeProcessor'
in its place, but continue favoring the old Search::Xapian
since that's all that's packaged for Debian 10.x stable.
Eric Wong [Wed, 26 Aug 2020 08:17:42 +0000 (08:17 +0000)]
msgmap: use v5.10.1
We use the defined-or (`//', `//=') operators in 5.10,
so require 5.10.1 like the rest of our codebase. Update
an outdated comment while we're at it.
Eric Wong [Wed, 26 Aug 2020 08:17:41 +0000 (08:17 +0000)]
over*: use v5.10.1, drop warnings
v5.10.1 lets us use the lighter parent.pm instead of base.pm,
and we'll rely on the shebang to enable warnings (or not).
While we're in the area, drop a no-longer-necessary import for
PublicInbox::Search, since OverIdx doesn't require search.
Eric Wong [Wed, 26 Aug 2020 08:17:40 +0000 (08:17 +0000)]
over: recent: remove expensive COUNT query
As noted in commit
87dca6d8d5988c5eb54019cca342450b0b7dd6b7
("www: rework query responses to avoid COUNT in SQLite"),
COUNT on many rows is expensive on big SQLite DBs.
We've already stopped using that code path long ago in WWW
while -imapd and -nntpd never used it. So we'll adjust our
remaining test cases to not need it, either.