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

CSV file size is funbounded when append option is true #70

Open
jensck opened this issue Jun 25, 2016 · 2 comments
Open

CSV file size is funbounded when append option is true #70

jensck opened this issue Jun 25, 2016 · 2 comments

Comments

@jensck
Copy link

jensck commented Jun 25, 2016

Browsing through the code, it looks like the CSV records file is "funbounded". (Funbounded, because what's more fun than a mystery file with an unbounded size silently filling up your disk? ;)

I see two issues with this:

  1. As mentioned above, the file could start taking up a significant amount of disk space. On a Jenkins server in particular, which will run complex, complete builds, all day, every day, this could add up very quickly.
  2. As the file grows, CSVSummaryReporter will get slower. If the file is big enough, this means that the build time plugin could, ironically, slow down the build by a meaningful amount (e.g.: more than a 1-2 seconds).

This isn't stopping me from using the plugin personally, but my team (and by extension, lots of other devs, I imagine) are uncomfortable adding a plugin which requires manual maintenance, since users will naturally forget to do it until the situation becomes unbearable, like running out of disk space, or build times going up by tens of seconds because it has to process a multi-gigabyte file.

@jensck jensck changed the title CSV file size is funbounded CSV file size is funbounded when append option is true Jun 25, 2016
@passy
Copy link
Owner

passy commented Jun 25, 2016

Thanks for opening the issue and the comprehensive explanation, @jensck! I'm also totally going to steal that term funbounded. :)

The same issue came up internally but we decided to defer working on a solution so far. To me, the second risk was actually more important than the first as the whole point of the plugin was to lead to faster builds - while this could lead to the exact opposite.

I'd like to avoid reinventing the wheel here and log truncation and rotation seems like it should be a pretty well researched topic. Do you - or anyone else - have any suggestions on what could be used here?

@jensck
Copy link
Author

jensck commented Jun 25, 2016

Glad you liked "funbounded" -- that's a gem from my former colleagues at Code42 which I thought deserved to enter the broader hacker lexicon. :)

As for the solution, some kind of log rollover approach is what came to mind for me. There might be more sophisticated approaches that are worth exploring if needed, but here's a simple first cut:

Add a config option specifying the number of days worth of events to keep. While this isn't a perfect solution for predicting log size, it's arguably the most useful, relatable measurement.

  • It should have a default which seems reasonable for a moderately complex project on a reasonably recent laptop
  • Allow for a value of -1 if people actually want funbounded logs
  • when the limit is hit, just erase the events which are past the limit, instead of trying to roll them over into another file or something, but spit out a long message about what's happening

I don't have any specific thoughts about implementation, but the performance of the JVM and the availability of great IO libraries like Okio should make it fairly straightforward?

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

No branches or pull requests

2 participants