]> Sergey Matveev's repositories - public-inbox.git/commit
lei: q: lock stdout on overview output
authorEric Wong <e@80x24.org>
Thu, 14 Jan 2021 07:06:24 +0000 (19:06 -1200)
committerEric Wong <e@80x24.org>
Fri, 15 Jan 2021 00:19:07 +0000 (00:19 +0000)
commitf49d6a9ac8ff542c625e909798ef0947df45f34e
treee0623d0650944220dfa324273ec927dd23c56901
parentc7b789a770bbe9bbc262af850d863dee4efe8371
lei: 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.
MANIFEST
lib/PublicInbox/LeiOverview.pm
lib/PublicInbox/LeiXSearch.pm
lib/PublicInbox/Lock.pm
t/lei_overview.t [new file with mode: 0644]