Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Conversation

@siu
Copy link
Contributor

@siu siu commented Oct 12, 2017

This is a follow-up of #286. This time the cache entry directory is replaced atomically.

With these changes all the files written by clcache are replaced atomically on disk, preventing cache corruption when the clcache process is terminated in the middle of a write.

siu added 6 commits October 12, 2017 13:05
This will help refactoring to write first to a temporary folder and replace.
This guarantees that the whole cache entry is replaced atomically. This precents cache corruption when the clcache process is terminated in the middle of a write.
@frerich frerich merged commit 30ac5b9 into frerich:master Oct 13, 2017
@frerich
Copy link
Owner

frerich commented Oct 13, 2017

Hmm, good stuff - I can't think of much when reviewing this code. I suppose it's hard to write a test for this, so I'll merge. Thanks!

siu pushed a commit to siu/clcache that referenced this pull request Oct 16, 2017
The signal handlers were introduced to avoid cache corruption when the
clcache process is stopped in the middle of a write to the cache
(statistics, manifests or objects). See frerich#233. Even if SIGINT and SIGTERM
were ignored the cache still had a chance to be corrupted in the event
of a SIGTERM (which cannot be ignored).

Since frerich#233 the writing of files to the cache has been improved to
replace the files atomically, reducing the risk of storing corrupted
files in the cache. See pull requests frerich#286, frerich#292 and frerich#296. Therefore
ignoring these signals is not needed anymore.
@siu siu mentioned this pull request Oct 16, 2017
siu pushed a commit to siu/clcache that referenced this pull request Oct 30, 2017
The signal handlers were introduced to avoid cache corruption when the
clcache process is stopped in the middle of a write to the cache
(statistics, manifests or objects). See frerich#233. Even if SIGINT and SIGTERM
were ignored the cache still had a chance to be corrupted in the event
of a SIGTERM (which cannot be ignored).

Since frerich#233 the writing of files to the cache has been improved to
replace the files atomically, reducing the risk of storing corrupted
files in the cache. See pull requests frerich#286, frerich#292 and frerich#296. Therefore
ignoring these signals is not needed anymore.
siu pushed a commit to siu/clcache that referenced this pull request Oct 30, 2017
The signal handlers were introduced to avoid cache corruption when the
clcache process is stopped in the middle of a write to the cache
(statistics, manifests or objects). See frerich#233. Even if SIGINT and SIGTERM
were ignored the cache still had a chance to be corrupted in the event
of a SIGTERM (which cannot be ignored).

Since frerich#233 the writing of files to the cache has been improved to
replace the files atomically, reducing the risk of storing corrupted
files in the cache. See pull requests frerich#286, frerich#292 and frerich#296. Therefore
ignoring these signals is not needed anymore.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants