Repository navigation
Commit 7df1b64
committed
fix(opensearch-operator): bound the calls that take a context from the caller
The first pass bounded the 15 calls the client makes on its own behalf and left
the 28 that take a context from the caller to the transport. That is not a bound
on them: ResponseHeaderTimeout stops counting once the headers arrive, so a body
that starts and then stops waits for as long as the process lives, and nothing on
the reconcile path puts a deadline on the context it hands in. One of those 28 is
readVotingConfigState, reached from the bootstrap-retire path where the reported
silence starts.
The five doHTTP helpers now derive the same requestTimeout. The deadline has to
outlive the call, because these hand the body back still open, so the cancel
rides on the body and is released when the body is closed, which is how
http.Client applies its own Timeout.
Two tests come with that: a body that stops halfway is abandoned, and a body is
still readable after the call that fetched it has returned. Each was checked
against the mutation it exists to catch, dropping the deadline and cancelling on
return.
The stalled-server test kept its accepted connections in a local that went out of
scope. net.netFD carries a finalizer that closes the descriptor, so a collection
turned the server from one that says nothing into one that resets the connection,
and the test passed with ResponseHeaderTimeout removed. The connections are now
held for the test's life, and it forces a collection every 10ms to keep that
honest: with the bound removed it now fails after the grace period.
The Dockerfile entry gains the drop condition every other entry carries, and
names the one wait that is left, the product check inside opensearch-go.
Assisted-by: LLM
Signed-off-by: IvanHunters <[email protected]>1 parent c5e9062 commit 7df1b64
2 files changed
Lines changed: 334 additions & 50 deletions
File tree
- packages/system/opensearch-operator/images/opensearch-operator
- patches
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
0 commit comments