Skip to content
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
rgulewich merged 2 commits into
masterfrom
rotate-out-files
Apr 2, 2020
Merged

Rotate .out files to S3, so Tomcat apps don't run out of disk space#372
rgulewich merged 2 commits into
masterfrom
rotate-out-files

Conversation

@rgulewich

Copy link
Copy Markdown
Contributor

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.

@rgulewich rgulewich requested review from alekar and sargun April 1, 2020 23:07
@codecov

codecov Bot commented Apr 1, 2020

Copy link
Copy Markdown

Codecov Report

Merging #372 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #372   +/-   ##
======================================
  Coverage    7.38%   7.38%           
======================================
  Files         328     328           
  Lines       64086   64086           
======================================
  Hits         4733    4733           
  Misses      58804   58804           
  Partials      549     549           
Impacted Files Coverage Δ
filesystems/watcher.go 63.11% <ø> (ø)

Comment thread filesystems/watcher_test.go Outdated
@@ -206,73 +206,49 @@ func TestDoubleUpload(t *testing.T) { // nolint: gocyclo

func TestRotateRegexp(t *testing.T) { // nolint: gocyclo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should be able to remove the nolint here.

Comment thread filesystems/watcher.go
regexp.MustCompile(`stdout.[\d_\.]+$`),
regexp.MustCompile(`stderr.[\d_\.]+$`),
regexp.MustCompile(`[\d-_]+.log`),
regexp.MustCompile(`[\d-_]+.out`),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I imagine this is a temporary hack?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As long as we have Tomcat apps running on Titus, we'll need to support this.

Comment thread filesystems/watcher_test.go Outdated
}
assert.False(t, shouldRotate, "%s should not rotate", nqBadCore)

shouldRotate = CheckFileForRotation("catalina_20200330_21.out", nil)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

result bool
regexp *regexp.Regexp
}{
{"stdout", false, nil},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fancy.

@rgulewich rgulewich merged commit 5116be3 into master Apr 2, 2020
@rgulewich rgulewich deleted the rotate-out-files branch April 2, 2020 00:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants