about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiOverview.pm
DateCommit message (Collapse)
2021-01-18lei: q: results output to Maildir and mbox* working
All the augment and deduplication stuff seems to be working based on unit tests. OpPipe is a nice general addition that will probably make future state machines easier.
2021-01-18lei_to_mail: prepare for worker offload
We'll be doing most of the work in forked off worker processes, so ensure some of it is fork and serialization-friendly.
2021-01-15lei: q: lock stdout on overview output
Most writes to stdout aren't atomic and we need locking to prevent workers from interleaving and corrupting JSON output. The one case stdout won't require locking is if it's pointed to a regular file with O_APPEND; as POSIX O_APPEND semantics guarantees atomicity.
2021-01-14lei_overview: rename "references" to "refs"
"references" was too long of a name compared to the other field names we output in the JSON. While we currently don't have a "refs:" search prefix for the "References:" header, we may in the future.
2021-01-14search: rename "ts:" prefix to "rt:"
Meaning "Received time", as it is the best description of the value we use from the "Received:" header, if present. JMAP calls it "receivedAt", but "rt:" seems like a better abbreviation being in line with "dt:" for the "Date" header. "Timestamp" ("ts") was potentially ambiguous given the presence of the "Date" header.
2021-01-14lei: test SIGPIPE, stop xsearch workers on client abort
The new test ensures consistency between oneshot and client/daemon users. Cancelling an in-progress result now also stops xsearch workers to avoid wasted CPU and I/O. Note the lei->atfork_child_wq usage changes, it is to workaround a bug in Perl 5: http://nntp.perl.org/group/perl.perl5.porters/258784 <CAHhgV8hPbcmkzWizp6Vijw921M5BOXixj4+zTh3nRS9vRBYk8w@mail.gmail.com> This switches the internal protocol to use SOCK_SEQPACKET AF_UNIX sockets to prevent merging messages from the daemon to client to run pager and kill/exit the client script.
2021-01-12lei: query: restore JSON output overview
This internal API is better suited for fork-friendliness (but locking + dedupe still needs to be re-added). Normal "json" is the default, though stream-friendly "concatjson" and "jsonl" (AKA "ndjson" AKA "ldjson") all seem working (though tests aren't working, yet). For normal "json", the biggest downside is the necessity of a trailing "null" element at the end of the array because of parallel processes, since (AFAIK) regular JSON doesn't allow trailing commas, unlike JavaScript.