Date | Commit message (Collapse) |
|
Changes will be coming for MsgTime to stop depending on
Date::Parse due to lack of package availability on OpenBSD
and suboptimal performance on RFC822 dates.
|
|
This is a transitionary interface which does NOT require an
event loop. It can be plugged into in current synchronous code
without major surgery.
It allows HTTP/1.1 pipelining-like functionality by taking
advantage of predictable and well-specified POSIX pipe semantics
by stuffing multiple git cat-file requests into the --batch pipe
With xt/git_async_cmp.t and GIANT_GIT_DIR=git.git, the async
interface is 10-25% faster than the synchronous interface since
it can keep the "git cat-file" process busier.
This is expected to improve performance on systems with slower
storage (but multiple cores).
|
|
We can replace the GNU-isms for building docs with Perl5
equivalents. The only downside is the resulting Makefile
gets larger, but that's the price of portability.
|
|
run_die() doesn't require an $env arg, so there's no
point passing "undef" to it.
|
|
It's unnecessary code which I'm not sure we ever used. In
retrospect, completely clearing the environment doesn't make
sense for the processes we spawn. We don't need to clobber
individual environment variables in our code, either
(and if we did for tests, we can use 'local').
|
|
We can create a stamp to avoid rerunning the check unless
NEWS.atom changes (and it will, soon, I hope :>).
|
|
SpamAssassin has used re2c (via sa-compile) for many years, now,
and it seems to work fine, there. GMime also looks promising
when combined with Inline::C since GMime can operate on mmap-ed
regions.
Given the inevitable demise of many .orgs when price rise;
supporting a URL rewriter similar to .mailmap makes sense.
And HTTP CONNECT seems like something our -httpd can support
to let firewalled users read over NNTP.
|
|
I haven't noticed this being a problem in practice, but
be consistent with the rest of the singleton stuff.
Since we always call Reset() at load time, only do
initialization in that sub and not at declaration.
|
|
We can localize changes to $0 so $0 is restored when the
"script" sub is done. This will be helpful when we encounter
a stuck/slow processes during our tests (hopefully never!)
|
|
We don't want the user's ~/.public-inbox/config to be read from
during tests. I only noticed this because I had a non-existent
pathname for one of my inboxes :x
I've also verified this change by running "inotifywait
~/.public-inbox/config -m" in another terminal while running
"make check"; (perhaps a portable solution could make it
into the test suite).
|
|
Since we give users no indication or control of how "git gc"
runs, showing its progress is confusing.
|
|
Test output can be a terminal if running as "perl -I lib t/$FOO.t",
and showing fsck progress is pointless for tests.
|
|
Tested FreeBSD 11.2. I'm starting to think I'm too conservative
with this check and it could be safely expanded to cover any OS
with UNIX sockets.
|
|
We need to force an update to Makefile (not Makefile.PL) when
MANIFEST changes. Since "Makefile" (aka. "$(FIRST_MAKEFILE)")
is already a single-colon make target; we can't create a
double-colon rule to augment it. So we'll continue using a
"Makefile.PL" rule, but have it recreate the resulting Makefile
Finally, change the "check" target to use "prove -b" instead of
"prove -l" so we test against "blib/lib", since what's in the
"blib" dir will be installed.
Fixes: 4c20de0694d06ff3 ("Makefile.PL: add dependency on MANIFEST contents")
|
|
Our attempt at using a self-pipe in signal handlers was
ineffective, since pure Perl code execution is deferred
and Perl doesn't use an internal self-pipe/eventfd. In
retrospect, I actually prefer the simplicity of Perl in
this regard...
We can use sigprocmask() from Perl, so we can introduce
signalfd(2) and EVFILT_SIGNAL support on Linux and *BSD-based
systems, respectively. These OS primitives allow us to avoid a
race where Perl checks for signals right before epoll_wait() or
kevent() puts the process to sleep.
The (few) systems nowadays without signalfd(2) or IO::KQueue
will now see wakeups every second to avoid missed signals.
|
|
Oops, IO::KQueue support was broken due to this missing
constant. Add a new ds-kqxs.t test case to ensure we
test the IO::KQueue path if IO::KQueue is available.
|
|
I'm not sure if TZ minute offsets aside from '00' or '30' exist,
but lets just deal with them properly when negative. Examples
taken from various inboxes on lore.kernel.org. These are mostly
message from spammers, but some are legitimate messages.
|
|
Broken email clients sent the darndest things, make sure
we can still support them when we make Date::Parse optional.
|
|
Otherwise it's hard to figure what fails.
|
|
xt/ is typically reserved for "eXtended tests" intended for
the maintainers and not ordinary users. Since these require
special configuration and do nothing by waste cycles
during startup, they qualify.
|
|
It's more consistent with our current terminology and
"PI_DIR" is already used to override ~/.public-inbox/
(which holds "config" and possibly other files which affect
all inboxes for a particular user, but is not an inbox itself);
so stop advertising GIANT_PI_DIR in skip messages.
|
|
Newer versions of git enable the commit graph by default.
Since we blow away our temporary directories every test,
generating graphis is a waste and clutters stderr with
"Computing commit graph generation numbers" messages.
|
|
We'll also introduce a tmpdir() API to give tempdirs
consistent names.
|
|
Since we're using Perl 5.10.1 and File::Temp 0.19+, we don't
need Xtmpdirs at all for cleaning up tempdirs on failure and
can just rely on the DESTROY handler provided by File::Temp.
|
|
Threads are officially discouraged by perl5-porters and proves
problematic with my Perl installation when using run_mode=1
to speed up tests. So just use fork() and pipes to share
results from Net::NNTP.
|
|
We can shave several hundred milliseconds off tests which spawn
daemons by preloading and avoiding startup time for common
modules which are already loaded in the parent process.
This also gives ENV{TAIL} support to all tests which support
daemons which log to stdout/stderr.
|
|
While the master process has a self-pipe to avoid missing
signals, worker processes lack that aside from a pipe to
detect master death.
That pipe doesn't exist when there's no master process,
so it's possible DS::close never finishes because it
never woke up from epoll_wait. So create a pipe on
the worker_quit signal and force it into epoll/kevent
so it wakes up right away.
|
|
We need to block signals in workers during respawns
until they're ready to receive signals.
|
|
`$SIG{FOO} = "IGNORE"' will cause the daemon to miss signals
entirely. Instead, we can use sigprocmask to block signal
delivery until we have our signal handlers setup. This closes a
race where a PID file can be written for an init script and a
signal to be dropped via "IGNORE".
|
|
As described in prove(1), .prove is storage for --state=save
and .proverc allows per-worktree customizations.
|
|
It seems caching can happen within OpenSSL or negotiation
can be delayed in some cases. In any case, don't barf on
PublicInbox::TLS::epollbit() when connect_SSL succeeds
unexpectedly.
|
|
We need to ensure the worker process is terminated before
starting a new connection, so leave a persistent HTTP/1.1
connection open and wait for the SIGKILL to take effect
and drop the client.
|
|
We did not have a test for this, and need to guard against
regressions when changing Xapcmd to use File::Temp->newdir
in future commits.
|
|
Use the "-q" flag like everywhere else.
|
|
The "strict" pragma makes code easier to debug, and we had
undeclared variables as a result in t/watch_maildir_v2.t.
So use it everywhere to be consistent with the rest of our
code.
|
|
There were still a few places where we used worker processes
unnecessarily in tests, causing a small amount of unnecessary
overhead.
Followup-to: ad221e9b2852f6c5 ("t/*.t: disable nntpd/httpd worker processes in most tests")
|
|
Perl 5.16.3 (and possibly older versions) fails with the
following errors (from CentOS7):
Use of ?PATTERN? without explicit operator is deprecated
Search pattern not terminated
|
|
This is distributed with Perl 5.10.1 and onwards, so it should
not be an installation burden for any users. I'm planning to
move away from tempdir() entirely and use File::Temp->newdir to
remove dependencies on END{} blocks.
|
|
This more than doubles the speed of the test, since we make
many invocations of -xcpdb.
|
|
This more than doubles the speed of these tests
|
|
This more than doubles the speed of the test.
|
|
This nets us a 20% speedup or so.
|
|
This only gives a 5% speedup or so, but anything helps.
|
|
This only gives a small 10% speedup or so, but anything helps.
|
|
This only gives a small ~10% speedup, since -httpd still
needs execve, but any speedup is welcome.
|
|
While this didn't use IPC::Run, having to reload several Perl
modules and scripts is slow and inefficient, so roughly
double the speed of this test.
|
|
We need to be careful and explicitly close FDs before doing
-index, since we can't rely on FD_CLOEXEC without execve(2)
syscalls.
|
|
It's no longer needed and we're able to speed up some
of our tests as a result.
|
|
This test runs more than twice as fast, now.
|
|
Another noticeable speedup, this test is roughly ~3x faster now.
|