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

Clean up files in processingDir (temporary staging dir) #629

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

DanielCosme
Copy link
Contributor

@DanielCosme DanielCosme commented Aug 9, 2024

This PR will fix an issue where the files created in the processingDir (when configured in the pipeline) were never cleaned up by Enduro.

It also changes the (Temporal) context that the clean-up activity uses to a disconnected one, this avoids the (unintended) cancellation of the context when the session gets released.

@joel-simpson
Copy link

This connects to #627

@djjuhasz djjuhasz self-requested a review August 12, 2024 15:35
Copy link
Contributor

@djjuhasz djjuhasz left a comment

Choose a reason for hiding this comment

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

Looks good overall @DanielCosme. I made one suggestion to improve the efficiency of the cleanup activities, but it's not a blocker.

w.logger.Error(err, "failed to clean up", "path", tinfo.Bundle.FullPathBeforeStrip)
}
}
if tempBlob != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling CleanUpActivity multiple times works, but there is some unnecessary overhead for temporal to schedule the activity and for the worker to pull it off the queue each time the activity runs. A more efficient option would be to have the clean up activity clean up all the temp files/directories at the same time. You could use https://github.com/artefactual-sdps/temporal-activities/blob/main/filesys/remove_activity.go or modify the local CleanUpActivity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback. Changes are here: 1c3f844

@DanielCosme DanielCosme merged commit 5677b89 into main Aug 12, 2024
8 of 9 checks passed
@DanielCosme DanielCosme deleted the clean-processing-dir branch August 12, 2024 20:06
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.

3 participants