Skip to content

Improve temp files handling and cleanup - #2639

Merged
AmmarAbouZor merged 1 commit into
esrlabs:masterfrom
AmmarAbouZor:improve-cleanup
Sep 9, 2026
Merged

AmmarAbouZor merged 1 commit into
esrlabs:masterfrom
AmmarAbouZor:improve-cleanup

Conversation

@AmmarAbouZor

Copy link
Copy Markdown
Contributor

This PR closes #2638

It replaces the age-based sweep of leftover session files with explicit ownership, so temp files are removed when their owner goes away instead of after 30 days.

To achieve this we are using OS lock files, creating one lock and directory per running chipmunk instance.
On start we scan chipmunk tmp dir for leftover and try to claim them which means that there are no other chipmunk instance that is using them right now. So they are safe to clean.

The current solution still support the previous time-based approach for the remaining files and it will fallback to it in case lock files aren't supported in the running environment.

Replace the age-based sweep of leftover session files with explicit
ownership, so temp files are removed when their owner goes away instead
of after 30 days.

To achieve this we are using OS lock files, creating one lock and
directory per running chipmunk instance.
On start we scan chipmunk tmp dir for leftover and try to claim them
which means that there are no other chipmunk instance that is using them
right now. So they are safe to clean.

The current solution still support the previous time-based approach for
the remaining files and it will fallback to it in case lock files aren't
supported in the running environment.
@AmmarAbouZor
AmmarAbouZor merged commit 0a6e832 into esrlabs:master Sep 9, 2026
1 check passed
@AmmarAbouZor
AmmarAbouZor deleted the improve-cleanup branch September 9, 2026 16:21
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.

Improve session files cleanup using OS lock files

1 participant