Commit Graph
12 Commits
Author SHA1 Message Date
Lars Wirzenius edc6cb407d refactor: rename NodeEventError to BrokerEventError, for clarity
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 09:59:11 +03:00
Lars Wirzenius 72c6a3396f refactor: rename NodeEventSource to BrokerEventSource
It returns broker events, not node events, so the new name is clearer.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 09:33:03 +03:00
Lars Wirzenius 85414e8673 feat: switch to structured logging only
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>
2024-08-23 10:03:49 +03:00
Lars Wirzenius 7a11bedc00 feat: make sure the HTML and JSON files get created
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>
2024-08-15 19:06:21 +03:00
Lars Wirzenius bdad79d442 feat: have threads notify each other of needing to do something
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>
2024-08-02 18:35:14 +03:00
Lars Wirzenius 800b2ffb44 feat: log when events end and when pushing a shutdown event
All to make the node operator's life easier to understand what's
happening.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 12:10:15 +03:00
Lars Wirzenius 3812aba1f7 feat: shorten log messages for events
Format them on one line, not on many lines. This makes logs easier to
skim.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 10:53:13 +03:00
Lars Wirzenius 3303d7d873 fix: typo in error variant name
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 17:37:56 +03:00
Lars Wirzenius d1c3f1801d feat: cib reads and process events in one subcommand
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-11 12:45:33 +03:00
Lars Wirzenius 14e2eaec01 feat: treat end-of-events as end, not as an error
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>
2024-07-11 12:45:33 +03:00
Lars Wirzenius e4573ec3fb feat: add a thread for adding events to queue
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-03 14:01:13 +03:00
Lars Wirzenius 77d08d3fcc feat: module to insert events into event queue
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>
2024-07-02 19:55:42 +03:00