Skip to content

Continue reading upon ErrTooLong in external server probe stderr read loop - #1144

Merged
manugarg merged 2 commits into
cloudprober:mainfrom
apolcyn:continue_reading
Sep 17, 2025
Merged

manugarg merged 2 commits into
cloudprober:mainfrom
apolcyn:continue_reading

Conversation

@apolcyn

@apolcyn apolcyn commented Sep 4, 2025 •

Copy link
Copy Markdown
Contributor

Currently, if an external server probe writes a large debug log to stderr exceeding bufio.MaxScanTokenSize, cloudprober's stderr read loop will terminate.

For server probes (rather than ONCE probes), this is a bad failure mode since the child process will continue attempting to log and will back up the stderr pipe. Eventually all attempts to log will block, causing prober goroutines to build up and OOM.

Approach here specifically checks for ErrTooLong (I wanted to make sure we do still terminate when we hit an EOF-like error). But, consider this a strawman, an approach that checks for all EOF-like errors might be more robust.

@manugarg

@manugarg

Copy link
Copy Markdown
Contributor

Thanks @apolcyn, it makes sense to me. Can you please fix the test failures.

@apolcyn

apolcyn commented Sep 15, 2025

Copy link
Copy Markdown
Contributor Author

Test failures fixed

@manugarg
manugarg merged commit 836aa00 into cloudprober:main Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants