Skip to content

Commit c9e1e3d

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 c9e1e3d

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

clcache/__main__.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import os
2121
import pickle
2222
import re
23-
import signal
2423
import subprocess
2524
import sys
2625
import threading
@@ -1513,15 +1512,7 @@ def createManifestEntry(manifestHash, includePaths):
15131512
return ManifestEntry(safeIncludes, includesContentHash, cachekey)
15141513

15151514

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-
15211515
def main():
1522-
1523-
installSignalHandlers()
1524-
15251516
if len(sys.argv) == 2 and sys.argv[1] == "--help":
15261517
print("""
15271518
clcache.py v{}

0 commit comments

Comments
 (0)