Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4df9bcd
Declare RabbitMQ queues and exchange durable by default
nook24 Aug 21, 2026
166b028
Fix memory errors and crashes in the event hot paths
nook24 Aug 25, 2026
c8ae2dc
Revive the build, CI and packaging
nook24 Aug 25, 2026
9c60a68
Modernise ownership, logging and configuration parsing
nook24 Aug 25, 2026
0730bb9
Add a unit test suite
nook24 Aug 25, 2026
b778ce7
Pin the message format against recorded broker output
nook24 Aug 25, 2026
d0c7f9b
Send the restart timestamp in the core restart message
nook24 Aug 25, 2026
48b9f3c
Bound the gearman worker poll and the worker loop
nook24 Aug 25, 2026
9cff7cc
Add micro benchmarks for the two hot message paths
nook24 Aug 25, 2026
9e7a51b
Skip charset detection when the input already is UTF-8
nook24 Aug 25, 2026
1fd5f16
Look up check result fields instead of scanning every key
nook24 Aug 25, 2026
4aeb9db
Measure the incidental costs from the plan's point 6
nook24 Aug 25, 2026
ea4c223
Serialise messages without insignificant whitespace
nook24 Aug 25, 2026
60de630
Take the queue name tables by reference instead of copying them
nook24 Aug 25, 2026
01be7e8
Document the performance work in the README
nook24 Aug 25, 2026
9185a36
Add a changelog
nook24 Aug 25, 2026
65441ef
Report a gearman outage on an interval instead of per message
nook24 Aug 25, 2026
2ae3281
Reconnect the gearman client after a job server restart
nook24 Aug 25, 2026
72aa758
Update the vendored naemon and nagios headers
nook24 Aug 25, 2026
5b57553
Build and run the test suite against nagios too
nook24 Aug 25, 2026
4b31cd8
Add end_time to the acknowledgement message
nook24 Aug 25, 2026
e18e738
Spell out the end_time difference between the two cores in the README
nook24 Aug 25, 2026
7d714e9
Report end_time as 0 under nagios instead of null
nook24 Aug 26, 2026
181a213
Stop the worker loop from throttling itself to one message per tick
nook24 Aug 26, 2026
0d9e8b3
Bound how long the worker may hold the monitoring core
nook24 Aug 26, 2026
f62c96d
Do not report a stuck worker as an overloaded one
nook24 Aug 26, 2026
da1087e
build outgoing messages with yyjson instead of json-c
nook24 Aug 29, 2026
ed63ffa
parse incoming messages with yyjson and drop json-c
nook24 Aug 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
Language: Cpp
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 120
AccessModifierOffset: -2
NamespaceIndentation: All
BreakBeforeBraces: Stroustrup
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: Yes
PointerAlignment: Right
SortIncludes: false
SpaceAfterTemplateKeyword: false
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build
devtools/**
!devtools/buildenv/**
.vscode/**
Expand Down
156 changes: 156 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: build

on:
push:
branches: [ master, rabbitmq-4 ]
pull_request:
workflow_dispatch:

jobs:
naemon:
name: naemon (${{ matrix.image }}, ${{ matrix.options }})
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image:
- ubuntu:22.04
- ubuntu:24.04
- debian:12
options:
- ''
include:
# The build options are only exercised on a single image, they are
# independent of the distribution.
- image: ubuntu:24.04
options: '-Dgearman=false'
- image: ubuntu:24.04
options: '-Drabbitmq=false'
steps:
- name: Install dependencies
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ pkg-config meson ninja-build git ca-certificates \
libglib2.0-dev libgearman-dev libjson-c-dev libuchardet-dev \
librabbitmq-dev libssl-dev uuid-dev

- uses: actions/checkout@v4

- name: Provide naemon headers
# We only need the headers to build the module, not libnaemon itself, so the
# checked in stubs stand in for an installed naemon-dev package.
run: |
set -e
mkdir -p /opt/naemon/include /usr/local/lib/pkgconfig
ln -s "$(readlink -f devtools/ci/naemon)" /opt/naemon/include/naemon
ln -s "$(readlink -f devtools/ci/naemon.pc)" /usr/local/lib/pkgconfig/naemon.pc

- name: Build
env:
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
run: |
meson setup --buildtype=release ${{ matrix.options }} build
ninja -C build

nagios:
name: nagios (${{ matrix.image }})
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image:
- ubuntu:24.04
- debian:12
steps:
- name: Install dependencies
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ pkg-config meson ninja-build git ca-certificates \
libglib2.0-dev libgearman-dev libjson-c-dev libuchardet-dev \
librabbitmq-dev libssl-dev uuid-dev

- uses: actions/checkout@v4

- name: Provide nagios headers
# The include dir has to live outside the source tree, meson rejects
# include_directories() pointing back into it.
run: |
set -e
mkdir -p /opt/nagios/include
ln -s "$(readlink -f devtools/ci/nagios)" /opt/nagios/include/nagios

- name: Build and test
run: |
meson setup --buildtype=release -Dtests=true -Dnagios=true \
-Dnagios_include_dir=/opt/nagios/include build
ninja -C build
meson test -C build --print-errorlogs

tests:
name: unit tests (${{ matrix.sanitize && 'sanitized' || 'plain' }})
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
strategy:
fail-fast: false
matrix:
sanitize: [false, true]
steps:
- name: Install dependencies
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ pkg-config meson ninja-build git ca-certificates \
libglib2.0-dev libgearman-dev libjson-c-dev libuchardet-dev \
librabbitmq-dev libssl-dev uuid-dev

- uses: actions/checkout@v4

- name: Provide naemon headers
run: |
set -e
mkdir -p /opt/naemon/include /usr/local/lib/pkgconfig
ln -s "$(readlink -f devtools/ci/naemon)" /opt/naemon/include/naemon
ln -s "$(readlink -f devtools/ci/naemon.pc)" /usr/local/lib/pkgconfig/naemon.pc

- name: Run tests
env:
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
run: |
if [ "${{ matrix.sanitize }}" = "true" ]; then
meson setup -Dtests=true -Db_sanitize=address,undefined build
else
meson setup -Dtests=true build
fi
meson test -C build --print-errorlogs

- name: Upload test logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: testlog-${{ matrix.sanitize }}
path: build/meson-logs/testlog.txt

format:
name: clang-format (advisory)
runs-on: ubuntu-latest
# Not blocking: the existing sources predate .clang-format and would need a one off
# reformat first. This job shows what would change so new code can converge on it.
continue-on-error: true
steps:
- uses: actions/checkout@v4

- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format

- name: Show formatting differences
run: |
find src tests -name '*.cpp' -o -name '*.h' \
| grep -v '^src/gsl.h$' \
| while read -r f; do clang-format "$f" | diff -u "$f" - || true; done
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
/.vs
/libgearman-1.0
/CppProperties.json
/.clang-format
/devtools/headers.zip
/devtools/include
/.idea
/cmake-build-debug
/vendor/json-c
/vendor/iconv
/vendor/yaml_cpp
/build
/build
# meson subprojects: keep the .wrap files, ignore what meson downloads
/subprojects/*
!/subprojects/*.wrap
Loading
Loading