Replace all use of log and env-logger crates with structured logging
using slog and slog-json.
Change the recently introduced logger module to use the slog-scope
crate. This avoids having to pass a reference to logger::Logging to
every place that needs to do any logging.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This is the most rudimentary requirement. It does not verify they get
updated as the CI broker continues running and doing things, as that's
a little difficult to arrange a test for.
This revealed a problem in how the `cib process-events` threads work
together, so fix that too. Changed the page updater thread to output
the HTML report and JSON status file at least once, even if there were
not events to process. In addition, the event processing thread uses a
timeout to receive notification of new events, so that it doesn't get
stuck, if there aren't any events coming from the node control socket.
Added some logging to make it easier to debug these things in the
future.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Event adding process notifies event processing thread that there are
new events, and the event processing thread notifies the report page
generation thread that a new run has finished. In addition, the
reporting thread reports after a while whether there are any new runs
or not, so that the page time stamp gets updated.
Also drop some now-unused code.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
If there are no more events to be received from the node, treat that
as an "end of file" situation, instead of as an error. In other words,
do a normal shutdown and let a system manager restart the CI broker if
need be.
Still handle actual errors when receiving node events as errors.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Make BrokerEvent de-serializable so that we can store them as JSON in
the database in the persistent event queue.
Signed-off-by: Lars Wirzenius <liw@liw.fi>