Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a job log length limit #2192

Merged
merged 2 commits into from
Aug 9, 2023
Merged

Add a job log length limit #2192

merged 2 commits into from
Aug 9, 2023

Conversation

DrJosh9000
Copy link
Contributor

@DrJosh9000 DrJosh9000 commented Jul 10, 2023

Since removing the need to hold the whole log in memory, there have been a few cases of long-running jobs logging lots of logs. This adds a (server-specified) limit, with a default of 1GiB.

Why not just limit it server side? Because the job itself should get some kind of pushback once it approaches or hits the limit. Returning errors when writing to the buffer feels like the right place.

@DrJosh9000 DrJosh9000 force-pushed the log-limit branch 2 times, most recently from 81df96b to 9f8dee9 Compare July 10, 2023 05:00
Copy link
Member

@pda pda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ 😁 ✨

agent/log_streamer.go Outdated Show resolved Hide resolved
agent/log_streamer.go Outdated Show resolved Hide resolved
@DrJosh9000 DrJosh9000 marked this pull request as ready for review July 13, 2023 02:02
@DrJosh9000 DrJosh9000 changed the title WIP: Add a job log length limit Add a job log length limit Jul 13, 2023
@DrJosh9000 DrJosh9000 requested a review from a team July 13, 2023 02:09
@DrJosh9000 DrJosh9000 force-pushed the log-limit branch 2 times, most recently from 36c6dcd to 6aa2978 Compare August 8, 2023 01:14
Comment on lines +116 to +120
ls.logger.Warn("The job log has reached %s in size, which has "+
"exceeded the maximum size (%s). Further logs may be dropped "+
"by the server, and a future version of the agent will stop "+
"sending logs at this point.",
humanize.Bytes(ls.bytes), humanize.Bytes(ls.conf.MaxSizeBytes))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewborden suggested this should just be a warning for now. Here's a cut of that.

Copy link
Contributor

@triarius triarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@DrJosh9000 DrJosh9000 merged commit 2fa907f into main Aug 9, 2023
1 check passed
@DrJosh9000 DrJosh9000 deleted the log-limit branch August 9, 2023 07:00
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.

None yet

3 participants