Skip to content

Pyjoyment.Plugin.Health, generate kubernetes: synchronous checks, an existing /healthz, liveness behind busy workers, and the budget of a stop - #610

Merged
dex4er merged 1 commit into
mainfrom
health-probes
Nov 12, 2026
Merged

dex4er merged 1 commit into
mainfrom
health-probes

Conversation

@dex4er

@dex4er dex4er commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

What Health behind a synchronous application, as Django under Mount on prefork -c 1, needs, in the plugin's docs and in generate kubernetes.

Changes

  • generate kubernetes:
    • --liveness-probe <port|path>: a port puts the liveness probe on tcpSocket, which the kernel accepts into the backlog behind busy workers of -c 1, where an HTTP probe waits and restarts a pod that is only busy; a path is an httpGet of its own. The startup and the readiness probes stay the ones of the plugin. Anything else is Unknown liveness probe.
    • --grace-period <seconds>: terminationGracePeriodSeconds, with PYJO_GRACEFUL_TIMEOUT of what the shutdown delay and 5 seconds leave of it, as 20 of the 30 seconds of the default of Kubernetes; an error with --graceful-timeout, or when nothing is left.
  • Pyjoyment.Plugin.Health docs:
    • the timeout bounds a check of a promise, a coroutine or an awaitable; a check that returns a value has run to its end before the timeout starts, so the timeouts of its client bound it, and the ORM of Django runs in Pyjo.IOLoop.blocking; a test shows a check that blocks longer than its timeout;
    • the endpoints take the paths of the routes and of a mounted application: healthz=None for one with a /healthz of its own;
    • liveness on tcpSocket with prefork -c 1.
  • The cookbook: the budget of 30 seconds with --grace-period 30, and the liveness on tcpSocket.
  • The skills deploy and mount: the options, the timeout of synchronous checks, and healthz=None.

Left out of the issue:

Validation

  • The suite on asyncio and on Pyjo.Reactor.Poll with PYTHONDEVMODE=1, without a ResourceWarning
  • kubectl kustomize of the manifests with both options
  • Sphinx with -W, trunk check, claude plugin validate

Closes #566

🤖 Generated with Claude Code

…existing /healthz, liveness behind busy workers, and the budget of a stop

generate kubernetes takes --liveness-probe, a port for a liveness probe on
tcpSocket, which the kernel accepts into the backlog behind the busy workers
of prefork -c 1, or a path of its own, and --grace-period, which sets
terminationGracePeriodSeconds and gives the graceful timeout of what the
shutdown delay and 5 seconds leave of it, as 20 seconds of the 30 that
Kubernetes gives by default.

The documentation of Health says that its timeout bounds the checks of a
promise or a coroutine, as a check that returns a value has run to its end
before the timeout starts, which a test shows, that its endpoints take the
paths of the routes and of a mounted application, which healthz=None leaves
their /healthz, and the liveness on tcpSocket with -c 1; the cookbook and the
skills deploy and mount say it too.

Closes #566

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dex4er dex4er added this to the 0.4.0 milestone Nov 12, 2026
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 Pyjoyment | 🛠️ Build #35841303 | 📁 Comparing bfb8f27 against latest (8dfcc32)

  🔍 Preview build  

3 files changed
± api/Pyjoyment_Command_Author_generate_kubernetes.html
± api/Pyjoyment_Plugin_Health.html
± guides/cookbook.html

@github-actions

Copy link
Copy Markdown
Contributor

Docker Smoke Test

Job Tests Passed ✅ Skipped ⚠️ Failed ❌ Log
smoke (app) 11 11 0 0 ✅ 131248348358
smoke (fastcgi) 5 5 0 0 ✅ 131248348243
smoke (kubernetes) 8 8 0 0 ✅ 131248348330
smoke (lambda) 2 2 0 0 ✅ 131248348341
smoke (lambda-image) 5 5 0 0 ✅ 131248348437
smoke (lambda-stream) 2 2 0 0 ✅ 131248348434
smoke (lambda-zip) 9 9 0 0 ✅ 131248348331
smoke (lite) 4 4 0 0 ✅ 131248347764
smoke (lite-pep723) 4 4 0 0 ✅ 131248348323
All 50 50 0 0 ✅

The run of the workflow

@github-actions

Copy link
Copy Markdown
Contributor

Tests

Job Tests Passed ✅ Skipped ⚠️ Failed ❌ Log
prove (python 3.12, Asyncio) 7437 7408 29 0 ✅ 131248349463
prove (python 3.12, Poll) 7409 7378 31 0 ✅ 131248349568
prove (python 3.13, Asyncio) 7437 7408 29 0 ✅ 131248349519
prove (python 3.13, Poll) 7409 7378 31 0 ✅ 131248349104
prove (python 3.14, Asyncio) 7468 7444 24 0 ✅ 131248349257
prove (python 3.14, Poll) 7440 7414 26 0 ✅ 131248349276
prove (python 3.15, Asyncio) 7468 7444 24 0 ✅ 131248349808
prove (python 3.15, Poll) 7440 7414 26 0 ✅ 131248351106
prove (python 3.15t, Asyncio) 7468 7444 24 0 ✅ 131248349730
prove (python 3.15t, Poll) 7440 7414 26 0 ✅ 131248349401
prove (python mise, Asyncio) 7547 7512 35 0 ✅ 131248349011
prove (python mise, Asyncio, Windows) 7268 7202 66 0 ✅ 131248349233
prove (python mise, Poll) 7519 7482 37 0 ✅ 131248348843
prove (python mise, Poll, Windows) 7240 7172 68 0 ✅ 131248349400
prove (python pypy3.12, Asyncio) 7437 7408 29 0 ✅ 131248349602
prove (python pypy3.12, Poll) 7409 7378 31 0 ✅ 131248349575
pytest (python 3.12, ubuntu-26.04-arm) 439 413 26 0 ✅ 131248349331
pytest (python 3.15, ubuntu-26.04-arm) 439 418 21 0 ✅ 131248348961
pytest (python 3.15, windows-2025) 439 390 49 0 ✅ 131248348821
servers (python 3.12) 54 54 0 0 ✅ 131248348430
servers (python 3.15) 53 53 0 0 ✅ 131248349287
All 120260 119628 632 0 ✅

The run of the workflow

@dex4er
dex4er merged commit 5976f17 into main Nov 12, 2026
36 checks passed
@dex4er
dex4er deleted the health-probes branch November 12, 2026 14:33
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.

Pyjoyment.Plugin.Health: synchronous checks, an existing /healthz, busy workers, and the budget of a stop

1 participant