Date | Commit message (Collapse) |
|
bogomips.org is due to expire, soon, and I'm not willing to pay
extortionist fees to Ethos Capital/PIR/ICANN to keep a .org. So
it's at yhbt.net, for now, but it will change again to
whatever's affordable... Identity is overrated.
Tor users can use .onions and kick ICANN to the curb:
torsocks w3m http://cmogstored.ou63pmih66umazou.onion/
torsocks git clone http://ou63pmih66umazou.onion/cmogstored.git/
torsocks w3m http://ou63pmih66umazou.onion/cmogstored-public/
|
|
copyrights updated by "update-copyright" in gnulib:
git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \
UPDATE_COPYRIGHT_USE_INTERVALS=2 \
xargs /path/to/gnulib/build-aux/update-copyright
While we're at it, SPDX seems to be the accepted way to identify
licenses nowadays, so lets use it.
git ls-files | xargs perl -i -p -e \
's,GPLv3 or later.*,GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>,g'
|
|
git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \
UPDATE_COPYRIGHT_USE_INTERVALS=2 \
xargs /path/to/gnulib/build-aux/update-copyright
|
|
Via update-copyright in gnulib, also added a few copyrights
to non-trivial files.
git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \
UPDATE_COPYRIGHT_USE_INTERVALS=2 \
xargs /path/to/gnulib/build-aux/update-copyright
|
|
In the future, we can use the update-copyright tool from gnulib:
git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \
UPDATE_COPYRIGHT_USE_INTERVALS=2 \
xargs /path/to/gnulib/build-aux/update-copyright
This project (nor any project I manage) has or ever will have have
copyright assignment. All contributors retain copyrights to their
contributions.
|
|
Due to data/event loss, we cannot rely on normal syscalls
(accept/epoll_wait) being cancellation points. The benefits of
using a standardized API to terminate threads asynchronously are
lost when toggling cancellation flags.
This implementation allows us to be more explicit and obvious at the
few points where our worker threads may exit and reduces the amount
of code we have. By avoiding the calls to pthread_setcancelstate,
we should halve the number of atomic operations required in the
common case (where the thread is not marked for termination).
|
|
Cancellation with epoll_wait, accept4 (and accept) may cause events
to be lost, as cancellation relies on signals anyways in glibc/Linux.
So instead, we use signaling ourselves and explicitly test for
cancellation only if we know we are interrupted and in a state where
a thread can safely be cancelled.
ref: http://mid.gmane.org/CAE2sS1gxQkqmcywQ07pmgNHM+CyqzMkuASVjmWDL+hgaTMURWQ@mail.gmail.com
|
|
gnulib did it for us in m4/gnulib-cache.m4, we'll match.
|
|
We now assume any non-zero timeout (not just infinite timeout)
is cancellable as well as interruptible. This means
mog_idleq_wait will no longer retry blindly on EINTR.
Handling of explicit device refreshes and aio_threads
is now easier-to-understand and follow.
|
|
kevent() has the ability to insert items into the kqueue
and retrieve with the same syscall. This allows us to
reduce syscalls on systems with kqueue support.
Regardless of whether this potential optimization can
improve performance, this makes the code smaller and
possibly easier to follow.
|
|
Epoll/kqueue descriptors are safely usable for this task given
the the ability to use one-shot notifications (which is
independent of level-triggering, even).
|
|
"cancellation" has a double-L, so "cancellable" should
be spelled with two Ls, too..
|
|
The kevent() function as implemented by libkqueue does not
support thread cancellation the same way a real kevent() (on
FreeBSD) appears to. So pretend no implementation of kevent()
is cancelable and handle cancellation ourselves using
pthread_testcancel(). This allows us to support any platform
where kevent() may work, since it's unclear if other *BSDs
implement kevent() as a cancellation point.
|
|
Allowing cancellation for a zero-time wait on epoll/kqueue
can potentially leave a descriptor hanging around forever
from a dead thread.
|
|
Since we already depend on many GCC extensions, we'll prefer
__thread to the more portable pthread_*-variants since it's
easier-to-use and read. clang also supports this GCC extension
and we've always depended on __thread for random state, anyways.
|
|
Hopefully things are less error-prone this way.
|
|
We want to avoid global resources like the active queue
as much as possible.
Unnecesarly bouncing of clients between different threads
and contention for the active queue lock hurts concurrency.
This contention is witnessed when parallel MD5 requests
are serviced during parallel fsck runs.
|
|
By going into single-threaded mode, we can drastically simplify our
shutdown sequence to avoid race conditions. This also allows us
to not have additional overhead during normal runtime: as all the
shutdown-specific logic is isolated to only a few portions of
the code.
Like all graceful shutdown schemes, this is one is still vulnerable to
race conditions due to network latency, but this one should be no worse
than any other server. Fortunately all requests we service are
idempotent.
|
|
It looks like we'll want to be able to sleep an
interval that's not "forever". We can replace
select() in the main loop with epoll/kqueue to
simplify our (eventual) graceful shutdown logic.
|
|
We use thread cancellation to shut down our queue
processing threads so we don't have to rely on signals
or cross-thread close() + EBADF from an epoll/kqueue
descriptor to know our queue is due for shutdown.
|
|
We'll really need proper shutdown handling :/
|
|
Nuked old history since it was missing copyright/GPLv3 notices.
|