diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go index 0d29aab387..895696daab 100644 --- a/weed/mount/weedfs.go +++ b/weed/mount/weedfs.go @@ -393,10 +393,10 @@ func NewSeaweedFileSystem(option *Option) *WFS { // // Use a timeout to avoid hanging on Ctrl-C if the filer is // unreachable: writeback flushes retry until it answers. - // If the timeout expires, skip the write-cache removal so that - // still-running goroutines can finish reading swap files, and leave - // the meta cache open: its invalidations wait for the handle locks - // those flushes hold. + // If the timeout expires, keep the cache dirs, which by default + // hold the write cache, so that still-running goroutines can finish + // reading swap files, and leave the meta cache open: its + // invalidations wait for the handle locks those flushes hold. // Open files are flushed first: their buffered writes would otherwise // die with the process. asyncDrained := true @@ -420,8 +420,8 @@ func NewSeaweedFileSystem(option *Option) *WFS { if asyncDrained { wfs.metaCache.Shutdown() os.RemoveAll(option.getUniqueCacheDirForWrite()) + os.RemoveAll(option.getUniqueCacheDirForRead()) } - os.RemoveAll(option.getUniqueCacheDirForRead()) if wfs.accessReporter != nil { wfs.accessReporter.stop() }