Eric Wong [Wed, 15 Nov 2023 04:32:38 +0000 (04:32 +0000)]
gcf2: fix autodie usage for older Perl
At least on Perl v5.16.3 on CentOS 7.x, use-ing autodie within
BEGIN {} affects all subroutines in that package, too. So just
use autodie at the top-level and rely on CORE::* and try_cat
to handle cases where autodie isn't desired.
Eric Wong [Wed, 15 Nov 2023 04:32:37 +0000 (04:32 +0000)]
gcf2client: add alias for PublicInbox::Git::fail
Ensure we can ->fail properly from other subs we can within
Gcf2Client. This doesn't fix the test failures on CentOS 7.x,
but tries to make it easier to fix underlying problems and
report OOM errors and other things which the test suite doesn't
touch on.
Eric Wong [Tue, 14 Nov 2023 22:46:57 +0000 (22:46 +0000)]
ds: run @post_loop_do if any user-queued events run
This ensures we can notice shutdown events in one-shot scripts
like -cindex (and eventually -clone/-fetch/-compact) without
forcing another real event to fire.
Eric Wong [Wed, 15 Nov 2023 05:55:49 +0000 (05:55 +0000)]
cindex: fix test when missing time(1) executable
It was only there for development purposes because associate is
slow, but it causes the test to get stuck on systems where it's
not available. So remove it and just call join(1posix).
Note: this is not the `time' builtin found in shells, this
executable shows memory and pagefault info (and more with the
`-v' switch). Unfortunately, it's not installed on many systems
despite being widely-packaged.
Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Eric Wong [Wed, 15 Nov 2023 01:04:56 +0000 (01:04 +0000)]
lei: use -signal numbers for old Perl
Unlike modern Perls, Perl 5.16.3 on CentOS doesn't accept
negative string signals like "-TERM" .
This only became a problem since commit b231d91f42d7
(treewide: enable warnings in all exec-ed processes)
made our code stricter by enabling more warnings.
In both cases, the kill is probably unnecessary and safe
to remove since we can rely on closing sockets to drop
processes.
The tests will check for strace >= 4.16, but version 4.24 that I have
does not accept --version, only -V. This works for both older and newer
strace, so switch to using "strace -V" for the check.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Eric Wong [Tue, 14 Nov 2023 00:32:20 +0000 (00:32 +0000)]
config: avoid eidx_key and newsgroup conflicts
Start lowercasing newsgroup names automatically since uppercase
names are incompatible with IMAP and POP3 and also causes
problems with both -extindex and -cindex.
We'll also warn on eidx_key and newsgroup conflicts to avoid
sometimes subtle breakage when using -extindex and -cindex.
Eric Wong [Mon, 13 Nov 2023 13:15:51 +0000 (13:15 +0000)]
cindex: support --associate-aggressive shortcut
This is shorthand to enabling --associate with the most
aggressive (and time-consuming) options available, starting from
the Unix epoch and having an unlimited window to join on.
Eric Wong [Mon, 13 Nov 2023 13:15:49 +0000 (13:15 +0000)]
cindex: do not guess integer maximum for Xapian
We can return an array to allow the caller to omit the internal
`-m' arg entirely. We'll also allow any non-positive values to
mean there's no limit; and we'll defer the "unlimited" case to
the XapHelper implementation. This frees us of having to deal
with mismatches between Perl and Xapian if Xapian was compiled
with 64-bit docid support and we're stuck on a 32-bit Perl
build.
Eric Wong [Mon, 13 Nov 2023 13:15:48 +0000 (13:15 +0000)]
xap_helper: better variable naming for key buffer
We'll use `kbuf' for the search object key, since we already use
the `fbuf' term in `struct fbuf'. This also adds an extra check
for open_memstream(3) failures in case of ENOMEM.
Eric Wong [Mon, 13 Nov 2023 13:15:47 +0000 (13:15 +0000)]
xap_helper: stricter and harsher error handling
We'll require an error stream for dump_ibx and dump_roots
commands; they're too important to ignore. Instead of writing
code to provide diagnostics for errors, rely on abort(3) and the
-ggdb3 compiler flag to generate nice core dumps for gdb since
all commands sent to xap_helper are from internal users.
We'll even abort on most usage errors since they could be
bugs in split2argv or our use of getopt(3).
We'll also just exit on ENOMEM errors since it's the easiest way
to recover from those errors by starting a new process which
closes all open Xapian DB handles.
Eric Wong [Mon, 13 Nov 2023 13:15:44 +0000 (13:15 +0000)]
cindex: delay associate until prune+indexing finish
Prune can get rid of invalid commits while indexing can add new
candidates for association, so we don't dump coderepo roots for
association until those are squared away. However, we can dump
inbox info since we don't touch inboxes while -cindex is running.
Eric Wong [Mon, 13 Nov 2023 13:15:42 +0000 (13:15 +0000)]
spawn: don't append to scalarrefs on stdout/stderr
None of our current code relies on it, and I can't imagine it's
something we'd need in the future, actually... This keeps the
door open for relying more on Spawn in TestCommon.
Eric Wong [Mon, 13 Nov 2023 13:15:41 +0000 (13:15 +0000)]
treewide: update read_all to avoid eof|close checks
read_all can be expanded to support FIFOs/pipes/sockets where
read-until-EOF behavior is desired. We can also rely on
wantarray to support splitting on EOL markers, but it's
hard-coded to support only `$/ eq "\n"' since (AFAIK)
it's the only way we use the wantarray form `readline'.
Eric Wong [Mon, 13 Nov 2023 13:15:40 +0000 (13:15 +0000)]
xap_client: spawn C++ xap_helper directly
No need to suffer through an extra dose of slow Perl load times
when we can drive the build in the big parent Perl process and
get the executable path name to pass to spawn directly.
Eric Wong [Mon, 13 Nov 2023 13:15:39 +0000 (13:15 +0000)]
xap_helper_cxx: use -pipe by default in CXXFLAGS
-ggdb3 is already used for g++ and clang, and -pipe is supported
by clang even if it's a no-op. So just use it to speed up g++
since it saves me 30-40ms.
We'll also get rid of the explicit `-O0' since it's the default
for both clang and g++.
Eric Wong [Mon, 13 Nov 2023 13:15:38 +0000 (13:15 +0000)]
xap_helper_cxx: make the build process ccache-friendly
We need to have stable filenames and separate compilation
from the linkage stage for ccache to hit. So avoid the use
of a temporary directory and instead rely on a lock file to
guard against parallel builds.
Eric Wong [Mon, 13 Nov 2023 13:15:37 +0000 (13:15 +0000)]
xap_helper_cxx: use write_file helper
PublicInbox::IO already gets loaded by PublicInbox::Spawn, so
there's no avoiding it even if we want fast startup time :<
But startup time for this piece will be less relevant in the
near future...
Eric Wong [Mon, 13 Nov 2023 13:15:35 +0000 (13:15 +0000)]
tmpfile: check `stat' errors, use autodie for unlink
`stat' can fail due to bugs on our end or ENOMEM, but there's
no autodie support for it. So just die if `unlink' fails, since
the FS wouldn't be usable for tmpfiles in that state, anyways.
Eric Wong [Mon, 13 Nov 2023 13:15:34 +0000 (13:15 +0000)]
cindex: check `say' errors w/ close or ->flush
We actually need to rely on autodie `close' to check for errors,
since error-checking with `say' is not useful due to perlio
write buffering. We'll also stop relying on `say ... or die'
since it's needless noise.
Fixes: 19f9089343c9 (cindex: drop redundant close on regular FH)
Eric Wong [Mon, 13 Nov 2023 05:00:39 +0000 (05:00 +0000)]
xap_helper: reset getopt(3) properly in workers
I only noticed this while doing a full -cindex --associate with
--associate-date-range=30.years.ago and --associate-max=-1 (no
limit for Xapian) between local mirrors of lore and
git.kernel.org my glibc-based system.
Apparently, glibc requires `optind = 0' to reset getopt(3) in
our workers. Oddly, glibc appeared to work fine prior to this
change for the defaults (--associate-date-range=1.year.ago..
and --associate-max=50000).
BSDs and musl have an `optreset' variable which appear to do
the same thing, but I don't have space on BSD VMs to test full
associations.
While we're at it, we'll also keep `opterr' enabled to improve
error reporting.
Eric Wong [Sun, 12 Nov 2023 13:12:33 +0000 (13:12 +0000)]
lei: don't read --stdin terminals from daemon
We must use a foreground process to read from terminals
on stdin, otherwise weird things like lost keystrokes and
EIO can happen. So take advantage of ->send_exec_cmd to
spawn `cat' in the same way we spawn MUAs, pagers,
`git config --edit' and `git credential' from script/lei
Eric Wong [Sat, 11 Nov 2023 09:04:59 +0000 (09:04 +0000)]
doc: update README.unsubscribe
The whitelist was only used in the early days of its development
and hasn't existed for a while. I've largely forgotten this
thing exists since it's been working well...
Eric Wong [Sat, 11 Nov 2023 09:04:57 +0000 (09:04 +0000)]
mda|learn|watch: support dropUniqueUnsubscribe config
List-Unsubscribe headers with unique identifiers (such as those
generated by our examples/unsubscribe.milter) should not
end up in public archives. Add a new config knob to strip
List-Unsubscribe headers if they have the
`List-Unsubscribe-Post: List-Unsubscribe=One-Click'
header.
Unfortunately, this breaks DKIM signatures if the signature
covers either of these List-Unsubscribe* headers. However,
breaking DKIM is the lesser evil compared to any archive reader
being able to stop archival by an independent archivist.
As much as I would like this to be the default, it probably
affects few users at the moment since very few mailing lists
use unique identifiers in List-Unsubscribe (but that number
has grown, recently).
Eric Wong [Sat, 11 Nov 2023 09:04:56 +0000 (09:04 +0000)]
learn: fix redundant ham import on dual matches
When learning and injecting new messages ham, we want to avoid
wasting cycles importing the same message into an inbox twice
(once for the To/Cc match and once for the List-Id match). Our
existing %seen hash turned out to be ineffective since
PublicInbox::Inbox refs get re-blessed to PublicInbox::InboxWritable.
So we stop letting class name influence the hash key for tracking by
using the reference address instead. We can get the reference address
by performing an arithmetic operation (+ 0) instead of having to
pay the cost of importing Scalar::Util::refaddr.
Eric Wong [Fri, 10 Nov 2023 22:26:33 +0000 (22:26 +0000)]
t/lei-import: skip strace for restricted systems
Systems with Yama can restrict ptrace(2) (the underlying syscall
used by strace(1)) and make it difficult to test error handling
via error injection. Just skip the tests on such systems since
it's probably not worth the effort to start using prctl(2) to
enable the test on such systems.
This seems like a easy (but WWW-specific) way to get recently
created and recently active topics as suggested by Konstantin.
To do this with Xapian will require a new columns and
reindexing; and I'm not sure if the current lei handling of
search results by dumping results to a format readable by common
MUAs would work well with this. A new TUI may be required...
Eric Wong [Thu, 9 Nov 2023 10:09:45 +0000 (10:09 +0000)]
lei: get rid of autoreap usage
We can rely on Process::IO->DESTROY to close and reap
in these cases. This is the final step in eliminating
the wantarray invocations of popen_rd (and popen_wr).
Eric Wong [Thu, 9 Nov 2023 10:09:43 +0000 (10:09 +0000)]
lei_input: always close single `eml' inputs
This matches the behavior we have for multi-message mbox files
since we rely on ->close to detect errors on bad mboxes. This
ensures we'll notice errors reading single messages from stdin.
We'll also start relying more on strace error injection to test
error handling.
Eric Wong [Thu, 9 Nov 2023 10:09:42 +0000 (10:09 +0000)]
ipc: simplify partial sendmsg fallback
In the rare case sendmsg(2) isn't able to send the full amount
(due to buffers >=2GB on Linux), use print + (autodie)close
to send the remainder and retry on EINTR. `substr' should be
able to avoid a large malloc via offsets and CoW on modern Perl.
Eric Wong [Thu, 9 Nov 2023 10:09:36 +0000 (10:09 +0000)]
lei: reuse FDs atfork and close explicitly
We'll avoid having a redundant STDERR FD open in lei workers,
and some explicit close() on `lei up' sockets reduces the
likelyhood of inadvertantly open FDs causing processes to
linger.
Eric Wong [Thu, 9 Nov 2023 10:09:34 +0000 (10:09 +0000)]
lei_xsearch: put query in process title for debugging
Having queries in the process titles makes it easier to diagnose
stuck queries due to IPC problems. This was used to diagnose
commit e97a30e7624d (lei: fix SIGPIPE on large result sets to pager)).
Eric Wong [Tue, 7 Nov 2023 13:01:47 +0000 (13:01 +0000)]
lei: fix SIGPIPE on large result sets to pager
When dealing with large search results, we need to deal with
EPIPE not just from the pager, but also EPIPE or ECONNRESET
between lei_xsearch and lei2mail processes.
Without this fix, lei_xsearch processes could linger and get
stuck writing to dead lei2mail processes if a user aborts the
pager early during a large result set.
To ensure lei_xsearch processes don't linger around after
lei2mail workers all die, we must close $l2m->{-wq_s2} before
spawning lei_xsearch processes, since $l2m->{-wq_s2} is only
used in lei2mail workers.
For `git cat-file' processes, we also need to trigger
PublicInbox::Git->close to handle unpredictable destructor
ordering to avoid using uninitialized IO refs. This combines
with the `git_to_mail' change to deal with process cleanup
handling from premature shutdowns.
To test all this, we can't just rely on a single message being
large, but also need to rely on the result set being large
enough to saturate the lei_xsearch -> lei2mail socket so we
rely on GIANT_INBOX_DIR once again.
Eric Wong [Thu, 2 Nov 2023 09:35:39 +0000 (09:35 +0000)]
t/cindex+extsearch: use write_file, autodie, etc.
write_file is a new API which makes setting up config files more
pleasant, while autodie and scalarref redirects (in tests) have
been available for a while, now. So do what we can to reduce
the code burden we have.
Eric Wong [Thu, 2 Nov 2023 09:35:38 +0000 (09:35 +0000)]
move read_all, try_cat, and poll_in to PublicInbox::IO
The IO package seems like a better home for I/O subs than the
Git package. We lose the 60 second read timeout for `git
cat-file --batch-*' processes since it's probably not necessary
given how reliable the code has proven and things would fall
over hard in other ways if the storage device were completely
hosed.
Eric Wong [Thu, 2 Nov 2023 09:35:37 +0000 (09:35 +0000)]
treewide: use eof and close to detect readline errors
readline (<FH>) isn't wrapped by autodie, and there's no
way to know if read(2) errors truncated the readline output.
IO::Handle->error isn't reliable on Perl < v5.34.
Thus, combining the `eof' and `close' (combined with autodie) is
the only way we can detect read(2) errors (injected via strace)
when called via `readline' (aka <$fh>). Neither using `eof'
nor `close' alone is sufficient, they must be combined to detect
errors from buffered `readline'.
Eric Wong [Thu, 2 Nov 2023 09:35:36 +0000 (09:35 +0000)]
treewide: check alternates writes with eof + autodie
We must use eof() combined with close() to detect errors
in situations involving the readline()' op since `readline'
(and most buffered I/O libraries) have weak error detection
support.
This fixes error detection for files opened for read/write
access. The next commit will fix error detection for read-only
files.
Eric Wong [Thu, 2 Nov 2023 09:35:35 +0000 (09:35 +0000)]
spawn: support PerlIO layer in scalar redirects
We have to deal with UTF-8 data for generating patches, so make
it easier to pass Perl utf8 data to git, diff, sdiff, etc. to
avoid "Wide character" warnings.
Eric Wong [Thu, 2 Nov 2023 09:35:33 +0000 (09:35 +0000)]
replace ProcessIO with untied PublicInbox::IO
This fixes two major problems with the use of tie for filehandles:
* no way to do fcntl, stat, etc. calls directly on the tied handle,
forcing callers to use the `tied' perlop to access the underlying
IO::Handle
* needing separate classes to handle blocking and non-blocking I/O
As a result, Git->cleanup_if_unlinked, InputPipe->consume,
and Qspawn->_yield_start have fewer bizzare bits and we
can call `$io->blocking(0)' directly instead of
`(tied *$io)->{fh}->blocking(0)'
Having a PublicInbox::IO class will also allow us to support
custom read buffering which allows inspecting the current state.
Eric Wong [Thu, 2 Nov 2023 09:35:30 +0000 (09:35 +0000)]
treewide: use ->close to call ProcessIO->CLOSE
This will open the door for us to drop `tie' usage from
ProcessIO completely in favor of OO method dispatch. While
OO method dispatches (e.g. `$fh->close') are slower than normal
subroutine calls, it hardly matters in this case since process
teardown is a fairly rare operation and we continue to use
`close($fh)' for Maildir writes.
Eric Wong [Thu, 2 Nov 2023 09:35:29 +0000 (09:35 +0000)]
cindex: drop redundant close on regular FH
There's no need to waste optree space on close() statements for
file handles which are (effectively) read-only on their last use
and incapable of error checking in our Perl code (since they're
only read by git).
Let Perl refcounting take care of it so we have less code to
wade through when focusing on `close' statements which actually
matter.
Eric Wong [Thu, 2 Nov 2023 21:35:50 +0000 (21:35 +0000)]
ds: don't try ->close after ->accept_SSL failure
Eric Wong <e@80x24.org> wrote:
> --- a/lib/PublicInbox/DS.pm
> +++ b/lib/PublicInbox/DS.pm
> @@ -341,8 +341,8 @@ sub greet {
> my $ev = EPOLLIN;
> my $wbuf;
> if ($sock->can('accept_SSL') && !$sock->accept_SSL) {
> - return CORE::close($sock) if $! != EAGAIN;
> - $ev = PublicInbox::TLS::epollbit() or return CORE::close($sock);
> + return $sock->close if $! != EAGAIN;
> + $ev = PublicInbox::TLS::epollbit() or return $sock->close;
> $wbuf = [ \&accept_tls_step, $self->can('do_greet')];
> }
> new($self, $sock, $ev | EPOLLONESHOT);
Noticed this on deploy:
-----8<-----
Subject: [PATCH] ds: don't try ->close after ->accept_SSL failure
->accept_SSL failures leaves the socket ref as a GLOB (not
IO::Handle) and unable to respond to the ->close method.
Calling close in any form isn't actually necessary at all,
so just let refcounting destroy the socket.
Eric Wong [Thu, 2 Nov 2023 09:35:28 +0000 (09:35 +0000)]
treewide: use ->close method rather than CORE::close
It's easier-to-read and should open the door for us to get rid
of `tie' for ProcessIO without performance penalties for
more frequently-used perlop calls and ability to do `stat' directly
on the object instead of the awkward `tied' thing.
Eric Wong [Thu, 2 Nov 2023 09:35:27 +0000 (09:35 +0000)]
ds: replace FD map hash table with array
FDs are array indices into the kernel, anyways, so we can
take advantage of space savings and speedups because the
majority of FDs a big process has is going to end up in
the array, anyways.
Eric Wong [Wed, 1 Nov 2023 06:31:48 +0000 (06:31 +0000)]
git: reschedule cleanup if active
This is necessary to reliably cleanup cat-file processes for
coderepos in long-lived -netd and -httpd processes if they
haven't been accessed in a while.
Eric Wong [Tue, 31 Oct 2023 20:42:55 +0000 (20:42 +0000)]
ds: make ->close behave like CORE::close
Matching existing Perl IO semantics seems like a good idea to
reduce confusion in the future.
We'll also fix some outdated comments and update indentation
to match the rest of our code base since we're far detached from
Danga::Socket at this point.
Eric Wong [Tue, 31 Oct 2023 20:42:53 +0000 (20:42 +0000)]
watch: simplify DirIdle object cleanup
There's no need to waste time nor reach into DS internals to
map FDs to Perl objects, here. LEI.pm has never had to deal
with integer FDs for DirIdle, either.
Eric Wong [Tue, 31 Oct 2023 20:42:52 +0000 (20:42 +0000)]
ds: move maxevents further down the stack
The epoll implementation is the only one which respects the
limit (kevent would, but IO::KQueue does not). In any case,
I'm not a fan of the maxevents=1000 historical default since
it leads to fairness problems with shared non-blocking listeners
across multiple daemon workers.
Eric Wong [Tue, 31 Oct 2023 20:42:51 +0000 (20:42 +0000)]
ds: do not defer close
We can map all integer FDs to Perl objects once ->ep_wait returns,
so there's no need to play tricks elsewhere to ensure FDs can
be mapped to objects within the same event loop iteration.
Eric Wong [Tue, 31 Oct 2023 20:42:50 +0000 (20:42 +0000)]
ds: next_tick: shorten object lifetimes
Drop reference counts ASAP in case it saves us some memory
sooner rather than later. This ought to give us more predictable
resource use and ensure OnDestroy callbacks fire sooner.
There's no need to use `local' to clobber the arrayref anymore,
either.
AFAIK, this doesn't fix any known bug, but more predictability
will make it easier to debug things going forward.
Eric Wong [Tue, 31 Oct 2023 20:34:51 +0000 (20:34 +0000)]
xap_helper.pm: quiet undefined die at shutdown
Another attempt at doing what commit 35de8fdcbf290e25
(xap_helper.pm: quiet undefined warnings at shutdown, 2023-10-23)
tried to do. It turns out perl croaks (not warn/carp) when it sees
an undefined file handle, here.
Eric Wong [Mon, 30 Oct 2023 18:29:40 +0000 (18:29 +0000)]
poll+select: check EBADF + POLLNVAL errors
I hit this in via select running -cindex with some other
experimental patches. I can't reproduce the problem, though,
but this ensure we have a chance to diagnose it if it happens
again instead of looping on select(2) => EBADF.
Eric Wong [Sat, 28 Oct 2023 18:01:12 +0000 (18:01 +0000)]
examples/*.service: avoid `nobody' user on systemd
systemd complains about `User=nobody' since `nobody' has access
to all files which can't be mapped to a valid UID. We'll also
switch to `Group=ssl-cert' since that ought to be able to read
TLS certificates.
Eric Wong [Fri, 27 Oct 2023 22:21:11 +0000 (22:21 +0000)]
git: avoid extra stat(2) for git version
No sane installer will update executable files in place due to
ETXTBSY on execve. So save ourselves a stat(2) call by relying
on the special `CORE::stat(_)' case to reuse the cached result
from the `-x FILE' filetest in which().
Eric Wong [Fri, 27 Oct 2023 22:21:09 +0000 (22:21 +0000)]
spawn: avoid alloca in C pi_fork_exec
We don't have thread-safety to worry about, so just leave a few
allocations at process exit at worst. We'll also update some
comments about usage while we're at it.
Eric Wong [Fri, 27 Oct 2023 01:14:35 +0000 (01:14 +0000)]
lei: don't exit lei-daemon on ovv_begin failure
When ->ovv_begin is called in LeiXSearch->do_query in the top-level
lei-daemon process, $lei->{pkt_op_p} still exists. We must make
sure we're exiting the correct process since lei->out can call
lei->fail and lei->fail calls lei->x_it.
As to avoiding how I caused ->ovv_begin failures to begin with,
that's for a much bigger change...
Eric Wong [Thu, 26 Oct 2023 08:20:07 +0000 (08:20 +0000)]
cindex: clarify fatal vs non-fatal messages
cindex must be able to handle coderepos being deleted mid-run
since `public-inbox-clone --purge' may be running at the same
time. This is a step towards handling parallel invocations
of -cindex and public-inbox-clone as gracefully as possible
by improving error messages.
Eric Wong [Thu, 26 Oct 2023 08:20:06 +0000 (08:20 +0000)]
git: cleanup un-associated coderepo processes
It's possible to have many coderepos with no inbox association
that never see git->cleanup. So instead of tying git->cleanup
to inboxes, ensure it gets armed when ->watch_async is called
(since it's only called in our -netd or -httpd servers).
Eric Wong [Wed, 25 Oct 2023 15:33:49 +0000 (15:33 +0000)]
cindex: fix large prunes
When comm(1) has a lot of data to output, we must ensure we
explicitly close FDs of processes in previous stages of the
pipeline to ensure comm(1) to terminates properly.
This is difficult to test automatically with small test repos...
Fixes: 17b06aa32aac (cindex: start using run_await to simplify code)
While uncommon, some git repos have hundreds of thousands of
refs and slurping that output into memory can bloat the heap.
Introduce a sha_all sub in PublicInbox::SHA to loop until EOF
and rely on autodie for checking sysread errors.
Eric Wong [Wed, 25 Oct 2023 00:29:49 +0000 (00:29 +0000)]
cindex: use sysread for generating fingerprint
We use sysseek for this file handle elsewhere (since it's passed
to `git rev-list --stdin' multiple times), and sysread ensures
we can use a larger read buffer than the tiny 8K BUFSIZ Perl +
glibc is contrained to.
This also ensures we autodie on sysread failures, since the
autodie import for `read' was missing and we don't call `read'
anywhere else in this file.
Eric Wong [Wed, 25 Oct 2023 00:29:46 +0000 (00:29 +0000)]
cindex: use run_await to read extensions.objectFormat
This saves us the trouble of seeking ourselves by using existing
run_await functionality. We'll also be more robust to ensure we
only handle the result if the `git config' process exited without
a signal.