aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-10-20 22:54:34 -0700
committerChris Lu <chris.lu@gmail.com>2020-10-20 22:54:34 -0700
commitad652ffb97cfdf6d866352a37992ece1c1870248 (patch)
tree5e9afe4d4935fe8f8f85b00a54ed63b3da6b2461
parent20442dc1bc246b2f08e49ad65dbe69dcae86113e (diff)
downloadseaweedfs-ad652ffb97cfdf6d866352a37992ece1c1870248.tar.xz
seaweedfs-ad652ffb97cfdf6d866352a37992ece1c1870248.zip
avoid close closed channel
-rw-r--r--weed/filesys/filehandle.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index 0304eebb4..412d7e73f 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -185,8 +185,10 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err
}
// stop the goroutine
- fh.dirtyPages.chunkSaveErrChanClosed = true
- close(fh.dirtyPages.chunkSaveErrChan)
+ if !fh.dirtyPages.chunkSaveErrChanClosed {
+ fh.dirtyPages.chunkSaveErrChanClosed = true
+ close(fh.dirtyPages.chunkSaveErrChan)
+ }
return nil
}