Skip to content

Commit 2714cc0

Browse files
david-sinuela-pix4dsiu
authored andcommitted
Remove signal handlers
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.
1 parent 05b2931 commit 2714cc0

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

clcache/__main__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,15 +1513,7 @@ def createManifestEntry(manifestHash, includePaths):
15131513
return ManifestEntry(safeIncludes, includesContentHash, cachekey)
15141514

15151515

1516-
def installSignalHandlers():
1517-
# Ignore Ctrl-C and SIGTERM signals to avoid corrupting the cache
1518-
signal.signal(signal.SIGINT, signal.SIG_IGN)
1519-
signal.signal(signal.SIGTERM, signal.SIG_IGN)
1520-
15211516
def main():
1522-
1523-
installSignalHandlers()
1524-
15251517
if len(sys.argv) == 2 and sys.argv[1] == "--help":
15261518
print("""
15271519
clcache.py v{}

0 commit comments

Comments
 (0)