-
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
Fix logrotateadditionalfiles
deletion.
#2081
Conversation
Note that there are, broadly, three things to be cleaned up:
With this PR, we're set up so that 2 and 3 are either performed or skipped together. Is this what we want? Should 1 and 2 happen together, with the 15 minute delay applying only to 3? |
I think I agree that the 15 minute delay should apply to both 2 and 3. In particular because the S3Uploader needs a chance to get a at the logs for 2, which the 15 minute window is nice for. Overall PR seems fine. I think it's gonna be a matter of testing the common cases in staging. Good find on where we clean the task definition file. Couldn't remember earlier where we actually were informed about a sandbox still hanging around |
Tested successfully. At task termination time, app directory cleanup and logrotation happen immediately.
|
🚢 |
This PR aims to fix a scenario whereby
logrotateAdditionalFiles
marked withdeleteInExecutorCleanup
would never actually be deleted. The scenario was:logrotateAdditionalFiles
deletion is skipped because it hasn't been 15 minutes since task terminationSingularity/SingularityExecutor/src/main/java/com/hubspot/singularity/executor/task/SingularityExecutorTaskCleanup.java
Line 79 in 4dea957
I’ve plumbed through some logic for log cleanup which is similar to the logic for the sandbox
app/
directory cleanup. Which is to say, if it hasn’t been 15 minutes since task termination, we return aWAITING
state from the “immediate” cleanup process. This way, we allow scheduled cleanup to take another look at it later, and properly delete files which we had been logrotating for the lifetime of the task.