Commit b6e0618
committed
fix(preflight): cap COSI read with 2s timeout
Address review feedback from gemini-code-assist on
pkg/commands/preflight.go:21,85: the pre-flight COSI read had no
timeout, so a slow or unresponsive node could turn an informational
best-effort check into a blocker for apply. Wrap the safe.StateGet
call with context.WithTimeout (2s) inside cosiVersionReader. The
timeout is short enough to stay invisible on a healthy node and long
enough to clear any expected roundtrip; on a hung node, the reader
returns ok=false and the existing silent-on-error contract takes over.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>1 parent c2659c1 commit b6e0618
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
32 | 40 | | |
33 | 41 | | |
34 | 42 | | |
| |||
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
77 | 88 | | |
78 | 89 | | |
79 | 90 | | |
| |||
0 commit comments