Development chronicle — mb558 to mb560 · 3.4dev
For a long time, the achievement guardians performed their heaviest investigations right in the middle of the Great Hall. On a large IRC history, one unlucky message could therefore awaken an ancient SQL spell and freeze the room for far too long.
That chapter is now closed. 🏰
The three expensive CHANNEL_LOG achievement checks no longer run synchronously while Mediabot handles a PRIVMSG.
The hot path now performs one small and predictable action: it places the work in a bounded queue.
The Great Hall can keep talking while the archivists work elsewhere. ✨
Queued achievement work is now handled by a forked asynchronous worker.
The child process opens its own isolated MariaDB connection and never reuses the database socket inherited from the parent. It performs the historical scans, builds a bounded JSON response, and returns only validated results.
The parent remains in control:
TERM, then KILL if necessary;Prometheus now reports queue depth, in-flight work, results, timeouts and bounded drops. Grafana can finally distinguish a quiet tower from one where a spell has genuinely gone wrong. 📊
Two final details were corrected.
First, successful workers were accidentally reported to Prometheus as failed. Healthy completions now keep the truthful label:
result="ok"
Second, two static regression guards had become stricter than the contracts they were meant to protect:
The guards now check the real rules:
DBI->connect site must have bounded timeouts;This last mb560 guard round changes no runtime behaviour. It simply teaches the castle watchmen to inspect what truly exists instead of reciting an outdated map. 🗺️
These changes remove expensive achievement aggregation from Mediabot’s message-processing path without weakening the feature itself.
Users keep the same achievements and unlock conditions, while operators gain:
The complete offline suite finished successfully:
10980 / 10980 PASSED
The GitHub CI also validates the project on each push to master, including:
No database schema change was required.
The achievement system still follows the same rules, but its heavy work now happens behind guarded doors, with its own database connection, strict limits and honest observability.
The castle remains lively. The archivists remain busy. And no slow SQL spell is allowed to silence the Great Hall again. ⚡
You must be logged in to reply.