Add retry logic and logging for no-deps telemetry collection - #34
frank-novak wants to merge 3 commits into
Conversation
Mirrors the retry/logging fix already applied to support-bundle.sh: kubectl port-forward tunnels have been observed to serve one connection (the /healthz gate) then refuse the next, especially across kubectl/API-server version skew, silently producing empty telemetry files. Retry on connection-refused and surface a warning when a file still comes out empty.
ihorponom
left a comment
There was a problem hiding this comment.
It seems curl --retry doesn't truncate the output file between attempts when writing via shell redirection (>). If the tunnel drops mid-transfer (not just before connecting) and a retry succeeds, the new response gets appended after the leftover partial bytes from the failed attempt, producing a corrupted-but-non-empty JSON file that the new [! -s "$f"] empty check won't catch.
|
Updated so the output paths are used instead, good catch! |
All seems good, but the original commit was in |
Wrap curl calls in set +e/-e so exhausted retries don't abort the whole script under set -e, and use the same empty_file_check function + array pattern as support-bundle.sh.
9eade73 to
976e893
Compare
kubectl port-forward tunnels have been observed to serve one connection (the /healthz gate) then refuse the next, especially across kubectl/API-server version skew, silently producing empty telemetry files. Retry on connection-refused and surface a warning when a file still comes out empty.