Skip to content

fix: add retry support for health checks - #30

Open
naufalfx805-source wants to merge 2 commits into
SnowfallHD:mainfrom
naufalfx805-source:fix-health-check-retries
Open

fix: add retry support for health checks#30
naufalfx805-source wants to merge 2 commits into
SnowfallHD:mainfrom
naufalfx805-source:fix-health-check-retries

Conversation

@naufalfx805-source

Copy link
Copy Markdown

Summary

Adds configurable retry/backoff support for transient HTTP and TCP health-check failures so temporary connection refused or timeout conditions can recover before returning CRITICAL.

Closes #2.

Changes

  • Added --retries and --retry-backoff CLI flags.
  • Retries retryable HTTP/TCP exceptions such as connection refused and timeouts.
  • Preserves single-attempt behavior by default with --retries 0.
  • Adds attempts and latency_ms metadata to JSON health-check output.
  • Adds tools/health_check_retry_harness.py covering success-after-retry, exhausted-retry, and JSON retry metadata.

Testing

Ran locally:

python -m py_compile tools/health_check.py tools/health_check_retry_harness.py
python tools/health_check_retry_harness.py
python tools/health_check.py --help
python tools/health_check.py --service postgresql --json --retries 1 --retry-backoff 0
python -X utf8 build.py

Results:

  • py_compile passed.
  • Retry harness passed: health check retry harness passed.
  • CLI help shows --retries and --retry-backoff.
  • JSON output includes attempts and latency_ms.
  • python build.py initially hit Windows console encoding for the warning symbol, so I reran with python -X utf8 build.py.
  • Build then reached diagnostics but failed environment preflight because encryptly could not create a .logd artifact in this local environment. The generated diagnostic JSON is committed at diagnostic/build-3d7f3362.json and records the blocker.

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated, if applicable
  • Configuration or schema changes are documented, if applicable
  • No generated build artifacts are committed, except the required diagnostic build log
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

  • I would like to request that my diagnostic build log is removed before merging

@naufalfx805-source

Copy link
Copy Markdown
Author

This PR addresses the health check retry support described in the original issue scope. Ready for review. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TRACKER ONLY] Upstream bounty submission tracking — not open for new work

1 participant