You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b861756
Browse filesBrowse the repository at this point in the historyBrowse files
fix: drain_grace_seconds bounds a serve() that is still running after stop (#91)
A scoped entrypoint (consumer, daemon, one-shot) finishes its in-flight unit
inside serve(), and the Host awaited every serve() with no deadline. That work
ran outside any budget, DrainTimeoutError never fired, and readiness stayed
true until the slowest serve() returned.
Once stop is set the Host now withdraws readiness and gives every serve()
still running drain_grace_seconds + 5 s to return, the same allowance as a
drain() step. A serve() still running after that is cancelled, its kind is
logged, and a DrainTimeoutError goes through the existing timeouts path.
Closes#88
Copy file name to clipboardExpand all lines: docs/concepts/entrypoints.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ That is the whole contract. The Host never branches on what kind of entrypoint i
22
22
| Method | Called | Contract |
23
23
| --- | --- | --- |
24
24
|`bind(ctx)`| once, before readiness | Allocate, subscribe, register. **Accept nothing yet.** Raise if the resource is unavailable — the Host aborts startup instead of reporting ready. |
25
-
|`serve(stop=...)`| once, in a `TaskGroup`| Run until `stop` is set, then return **while still accepting**. Raise to report a fatal failure. |
25
+
|`serve(stop=...)`| once, in a `TaskGroup`| Run until `stop` is set, then return **while still accepting**. A unit already in flight may finish first, within `drain_grace_seconds`; after that the Host cancels it. Raise to report a fatal failure. |
26
26
|`drain(grace)`| on shutdown, reverse order | Stop intake. Let in-flight work finish within `grace` seconds. |
27
27
|`stop()`| after drain, reverse order | Hard stop. Release everything. Must be safe to call after `drain`. |
0 commit comments