Skip to content

Conversation

unexge
Copy link
Contributor

@unexge unexge commented Aug 12, 2025

Mountpoint tries to clean up the cache sub-directory during startup and exit in a blocking manner. This causes a cold start on Mountpoint if the cache sub-directory is not cleaned up in exit (e.g., if it's forcefully terminated) and if the cache sub-directory contains lots of files.

This change updates the clean up logic to do a rename first in the current thread to ensure Mountpoint starts with a fresh cache folder, and then spawns a detached background thread to remove the old cache directory. The cache sub-directory is still cleaned up in a blocking manner in the current thread during exit.

Does this change impact existing behavior?

The cache will now be cleaned up in a background thread, this change may:

  • Increase disk space usage temporarily during cleanup, as the new cache begins populating while the old cache still exists for a period of time
  • Prevent cache cleanup errors from being propagated, since Mountpoint startup is no longer blocked by the cache cleanup process. Errors will now be just logged instead of propagated
    • In the worst-case scenario, this could cause Mountpoint to leave orphaned cache folders

Does this change need a changelog entry? Does it require a version change?

Probably requires a changelog entry.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 12, 2025 17:04 — with GitHub Actions Failure
Mountpoint tries to clean up the cache sub-directory during startup and exit in a blocking manner.
This causes a cold start on Mountpoint if the cache sub-directory is not cleaned up in exit (e.g., if it's forcefully terminated)
and if the cache sub-directory contains lots of files.

This change updates the clean up logic to do a rename first in the current thread to ensure Mountpoint starts with a fresh cache folder,
and then spawns a detached background thread to remove the old cache directory.
The cache sub-directory is still cleaned up in a blocking manner in the current thread during exit.

Signed-off-by: Burak Varlı <burakvar@amazon.co.uk>
@unexge unexge force-pushed the push-zmwuoqtvxxxo branch from 70a0c98 to 536205f Compare August 13, 2025 09:43
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 13, 2025 09:43 — with GitHub Actions Failure
unexge added 3 commits August 14, 2025 14:23
Signed-off-by: Burak Varlı <burakvar@amazon.co.uk>
Signed-off-by: Burak Varlı <burakvar@amazon.co.uk>
Signed-off-by: Burak Varlı <burakvar@amazon.co.uk>
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests August 14, 2025 15:20 — with GitHub Actions Failure
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.

1 participant