-
Notifications
You must be signed in to change notification settings - Fork 188
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
Conversation
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
🚢 |
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