Document the worker idle RPC in the top-level and worker READMEs — Closes #371 - #372
Merged
Merged
Conversation
The idle surface shipped without documentation in either README, and the top-level README additionally described the worker as hosting two RPCs, which has contradicted wire.proto since idle landed. The worker package README owns the contract: what the poll returns and what its timeout means, how idle is measured, why polling cannot perturb the measurement, how worker idleness differs from the channel idleness discussed alongside it, and why IdleUnavailable descends from WoolError rather than RpcError. The top-level README carries the narrative and links there, matching how it already defers to the worker package on discovery-plane trust and credential rotation.
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
Document the worker idle RPC in both READMEs. The surface has shipped without documentation in either one, and the top-level README additionally described the worker as hosting two RPCs — a claim that has contradicted
wire.protosince idle landed, so a reader came away believing the capability does not exist.Split the material by the one-home-per-claim rule. The worker package README owns the contract, since that is where connection behavior is already documented in depth; the top-level README carries the narrative and links there, matching how it already defers to the worker package on discovery-plane trust and credential rotation.
IdleUnavailablegets exactly one home, in the new worker README section, with a pointer from the error-classification table rather than a second copy.Documentation only — no source, no tests, no behavior change.
Closes #371
Proposed changes
Add an Idle reporting section to the worker package README
Add
### Idle reportingunder## Connections, betweenConnection poolingandTransport configuration, covering four things a caller needs:WorkerConnection.idlereturns the continuous idle duration in seconds, wrappingrpc idle (Void) returns (Idle); the response is awool.protocol.Idlecarrying a singlesecondsfield. The optionaltimeoutis the deadline for the poll itself and must be positive, withNoneapplying none. The call draws a channel from the same pool a dispatch would.DispatchSessionnor enters the in-flight set, so reading the measurement cannot disturb it.ResourcePoolTTL two paragraphs above andWorkerOptions.max_connection_idle_msboth govern how long an unused channel survives, and neither depends on whether the worker at the other end is executing tasks. Placing this next to the pooling paragraph is the point: those are the terms a reader has just been given.UNIMPLEMENTED, surfacing asIdleUnavailable, which descends fromWoolErrorrather thanRpcErrorsoexcept RpcErrordoes not catch it. Every other gRPC failure classifies as it does for dispatch.Point at it from the error-classification table
Add one sentence beneath
### Error classificationnoting that the table covers dispatch-path failures where the behavior column is the load balancer's response, and that the idle poll — which reaches no load balancer — addsIdleUnavailable, linked to the new section. A pointer rather than a table row, because the table's "Dispatch behavior" column has no meaning for a poll that never enters dispatch.Correct the RPC count and add the narrative in the top-level README
Change "two RPCs" to three under
## Workersand nameidlealongsidedispatchandstop, with a parenthetical gloss matching the existing style.Add one paragraph after the
WorkerConnectiondescription under### Self-describing worker connections, covering the poll at narrative depth — what it measures, why zero-while-busy is what makes it a usable retirement signal for a supervisor, and whatIdleUnavailablemeans — then linking to the worker README section for the full contract.## Error handlingis deliberately untouched: its table is organized by dispatch phase and its rows describe load-balancer actions, so an idle row would misrepresent a call that has neither.