Change the queue processing to spawn a new thread for each new event
to process (run adapters for).
Previously we had N long-lived threads, where N is set in the
configuration setting `concurrent_adapters`. This is awkward if we
want to reload configuration, which is an open feature request.
The new structure is also a lot simpler, which hopefully means it'll
be more reliable.
serde-yaml was orphaned, so I switched to serde-yml, which is now
unmaintained and depends on libyml with a security issue. The new
replacement seems to be serde-norway.
May be worth thinking about not using YAML in the future.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
The cib configuration setting max_run_time didn't always work, because
its implementation only killed the adapter, not any child processes of
the adapter. We fix this by running the adapter in its own process
group, and killing the whole group if the time runs out.
In addition, the timeoutcmd.rs module (and the ChildProcess type) is
simplified, by making the deadline mandatory. It is no longer possible
to run an adapter without a timeout. This makes sense, as it'd not be
useful to allow an adapter to run indefinitely. The old behavior can
be simulated by setting a very long timeout, such as a year.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Change CI event creation to set the `from_node` field to the node id
in the Git ref being updated. Previously we set it to the `remote`
field in the node event, but that is id of the node from which our
local node got the `RefsUpdated` event, not the node where the change
was originally made.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Switch from the "slog" family of crates for structured logging to the
"tracing" family. There should be no significant changes to the log
messages, so I don't consider this to be a breaking change.
The benefit of this change is that it opens up the possibility to add
extra fields to the log messages as JSON values, instead of strings
that contain the values as JSON.
With slog we currently have this message::
{"msg":"broker database: /home/_rad/ci-broker.db"}
With slog or tracing we can change this to:
{"msg":"open database", "filename": "/home/_rad/ci-broker.db"}
With tracing we can have this:
{"msg":"open database","db":{"type":"sqlite","filename":"/home/_rad/ci-broker.db","size":12765}}
which would be, formatted prettily
{
"msg": "open database",
"db": {
"type": "sqlite",
"filename": "/home/_rad/ci-broker.db",
"size": 12765
}
}
Such extra fields can then be easily queried or otherwise processed
with programs, much more easily than having such programs parse text
fields as JSON before they can be processed.
Doing this with slog is supposed to be possible, but I have failed to
get it to work. The slog and tracing families of libraries seem
otherwise similar for our purposes.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This is primarily a stop-gap measure so I can have some notification
of CI runs, without having to manually check the report page. It may
also be useful for other people, who do not use Radicle themselves,
but are interested in CI runs on Radicle nodes.
Signed-off-by: Lars Wirzenius <liw@liw.fi>