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

Periodically reconcile the list of metadata files #2085

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

ssalinas
Copy link
Member

This is the simplest fix I could think of for our longer-term uploader leak issue. The most likely case is that we are occasionally missing a file update or not handling ti properly, since we always end up with more files in the filesystem than in memory. So, this periodically rescans the directory just like on startup. For the most part it will be a no-op, but will also serve to clean up files we may have missed so that things don't grow out of control

Copy link
Contributor

@WH77 WH77 left a comment

Choose a reason for hiding this comment

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

Seems like a reasonable solution to me, few minor questions that I don't think are actually issues.

fileSyncFuture = scheduler.scheduleAtFixedRate(() -> {
runLock.lock();
try {
readInitialFiles();
Copy link
Contributor

Choose a reason for hiding this comment

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

checking - do you know how long this process usually takes, and is there a concern that it'll hold the lock long enough to cause issues for the S3 uploads?

Copy link
Member Author

Choose a reason for hiding this comment

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

This whole process is async/background, nothing hits it live or like a service, and it only holds the lock for a second or two

@@ -209,6 +221,10 @@ public void shutdown() {
runLock.unlock();
}

if (fileSyncFuture != null) {
fileSyncFuture.cancel(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

why allow interrupts here but not for the upload future?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good Q, I don't remember why I put that there... Will take a second look at it

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah right, this one is just checking for new files, interrupting in the middle won't actually interrupt an upload. The uploaders themselves we want to give a better chance to finish

@pschoenfelder
Copy link
Contributor

🚢

@ssalinas ssalinas merged commit 65fe523 into master Mar 24, 2020
@ssalinas ssalinas deleted the s3_uploader_reconcile_files branch March 24, 2020 14:15
@ssalinas ssalinas added this to the 1.3.0 milestone Sep 24, 2020
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