Surface pgmq runtime state in doctor diagnostics#119
Merged
Conversation
When pgmq_client is None at runtime, events were silently dropped with only a DEBUG-level log — invisible by default and leaving no trace in the runtime state file. - Upgrade the emitter fallback log from DEBUG to WARNING so drops are immediately visible in normal log output - Record each dropped event in runtime_state.event_send_failures using the sentinel queue "<pgmq_disabled>" so the condition survives beyond the live process - Surface pgmq-disabled drops in `netengine status` with a clear WARNING line pointing operators to `netengine doctor` - Add check_pgmq_runtime_state() to db_doctor.py that reads the state file and emits a WARN DoctorCheckResult when drops are present - Wire the new probe into standard_probes() so `netengine doctor` shows the condition under the database group Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhwicpfSvKesuRxBHs9sQ2
redactable ^0.1.0 was added to pyproject.toml before the package was published to PyPI, making it impossible to regenerate poetry.lock and breaking all CI jobs. The codebase already imports it via importlib with a documented fallback for when it is unavailable, so removing it from the required deps is safe and matches the actual runtime behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhwicpfSvKesuRxBHs9sQ2
… action version - db_doctor.py: narrow type-ignore to import-untyped, annotate failures list properly - preflight.py: guard against None before int() in _parse_compose_port - routes.py: import _is_secret_field and _contains_private_pem from redaction module (fallback code referenced them but they were never imported, causing NameError) - ci.yaml: pin trivy-action to @0.29.0 (0.30.0 does not exist) - Reformat emitter.py, db_doctor.py, preflight.py with black Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhwicpfSvKesuRxBHs9sQ2
- ci.yaml: trivy-action versions use v-prefix tags (v0.29.0, not 0.29.0) - runner.py: reformat with black (pre-existing lint failure) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhwicpfSvKesuRxBHs9sQ2
…dep) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhwicpfSvKesuRxBHs9sQ2
…_doctor) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhwicpfSvKesuRxBHs9sQ2
…l packages) The previous licenses.md was generated from a developer machine with global Poetry tools installed; CI generates from the project venv only. Regenerate with 81 packages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhwicpfSvKesuRxBHs9sQ2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhwicpfSvKesuRxBHs9sQ2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds visibility into pgmq client wiring failures by tracking and surfacing events that were silently dropped when
pgmq_clientwas not available during runtime. The changes introduce a new diagnostic check and improve runtime state tracking to help users identify and resolve pgmq connectivity issues.Key Changes
New diagnostic check: Added
check_pgmq_runtime_state()indb_doctor.pythat inspects the runtime state file for events dropped due to pgmq client not being wired, providing actionable guidance when issues are detected.Runtime state tracking: Modified
emit_event()inevents/emitter.pyto record event send failures whenpgmq_clientis unavailable, changing from silent debug logging to explicit warning-level logging and failure recording.CLI status output: Enhanced
_print_status()incli/main.pyto display pgmq-disabled drops and other event send failures when present, directing users tonetengine doctorfor details.Shared constant: Introduced
_PGMQ_DISABLED_QUEUEconstant inevents/emitter.pyto consistently identify pgmq-disabled failures across the codebase.Doctor probe integration: Registered the new pgmq runtime state check as a standard diagnostic probe in
preflight.py.Implementation Details
event_send_failuresentries with queue type_PGMQ_DISABLED_QUEUE.https://claude.ai/code/session_01AhwicpfSvKesuRxBHs9sQ2