This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Rotate .out files to S3, so Tomcat apps don't run out of disk space#372
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #372 +/- ##
======================================
Coverage 7.38% 7.38%
======================================
Files 328 328
Lines 64086 64086
======================================
Hits 4733 4733
Misses 58804 58804
Partials 549 549
|
sargun
approved these changes
Apr 1, 2020
| @@ -206,73 +206,49 @@ func TestDoubleUpload(t *testing.T) { // nolint: gocyclo | |||
|
|
|||
| func TestRotateRegexp(t *testing.T) { // nolint: gocyclo | |||
Contributor
There was a problem hiding this comment.
You should be able to remove the nolint here.
| regexp.MustCompile(`stdout.[\d_\.]+$`), | ||
| regexp.MustCompile(`stderr.[\d_\.]+$`), | ||
| regexp.MustCompile(`[\d-_]+.log`), | ||
| regexp.MustCompile(`[\d-_]+.out`), |
Contributor
There was a problem hiding this comment.
I imagine this is a temporary hack?
Contributor
Author
There was a problem hiding this comment.
As long as we have Tomcat apps running on Titus, we'll need to support this.
| } | ||
| assert.False(t, shouldRotate, "%s should not rotate", nqBadCore) | ||
|
|
||
| shouldRotate = CheckFileForRotation("catalina_20200330_21.out", nil) |
Contributor
There was a problem hiding this comment.
Does it make sense to follow the pattern above:
catalainaOut := "catalina_20200330_21.out"
shouldRotate = CheckFileForRotation(catalinaOut, nil)
assert.True(t, shouldRotate, "%s should rotate")
Contributor
Author
There was a problem hiding this comment.
I started down that road, realized that I should turn this into a table-based test, and then decided that the diff was getting too big. I'll do the larger change as part of another commit.
sargun
reviewed
Apr 2, 2020
| result bool | ||
| regexp *regexp.Regexp | ||
| }{ | ||
| {"stdout", false, nil}, |
sargun
approved these changes
Apr 2, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tomcat writes files named like
catalina_20200331_00.out. We're currently not rotating / uploading these, which causes long-running Java apps to run out of disk space.