Goal is to directly use sled as a drop-in replacement for BTreeMaps,
which already maintain the state of reaction.
Those maps are now persisted by sled.
A lot of code is no longer needed, and is deleted in this commit.
This commit focuses on adapting FilterManager to sled.
TODO
- adapt ActionManager as well
- at startup, clean old matches
- at startup, clean old actions
- at startup, run still relevant actions
- at startup, remove sled trees that no longer correspond to something
in the configuration
- refactor socket.rs to remove complex state sharing, as sled can now be
directly used.
Introduces the nix dependency for the signal constants and the kill(1)
function.
The child process is now delegated to a dedicated function handle_child
that will ensure it terminated and reclaimed. On shutdown, this function
first ask nicely using SIGTERM the stream process to exit (maybe we'll
want to make that signal configurable as SIGINT is a good candidate as
well).
After 15s, if the child process still did not exit, it is killed with
SIGKILL. Which is usually enough. But to make sure not to block
reaction's shutdown (which could interfere unintentionally with, for
example, the management of the database), there is another 5s timeout
after which we give up on waiting for the child process since at this
point it's most likely deadlocked in some way at the kernel level.
handle_child now handles the error message about the stream command
early exit. So there is no need for a communication channel between this
function and handle_io which just processes the process' output.
reaction's configuration now has a state_directory optional member,
which is where it will save its databases. defaults to cwd.
added a lot of code necessary to properly test databases.
The new tests are currently failing, which is good : they'll permit
to hunt down this database consistency bug.
also removed some indirect dependencies via features removal,
and moved test dependencies to dedicated [dev-dependencies]
also small fix on an nft46.c function type and empty conf file
for ccls LSP server.