mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-24 06:31:59 +08:00
avoid closing chunkSaveErrChan too early
This commit is contained in:
parent
e0fcab47c0
commit
a9662d44ac
@ -183,17 +183,20 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err
|
|||||||
}
|
}
|
||||||
|
|
||||||
if fh.f.isOpen == 0 {
|
if fh.f.isOpen == 0 {
|
||||||
|
|
||||||
if err := fh.doFlush(ctx, req.Header); err != nil {
|
if err := fh.doFlush(ctx, req.Header); err != nil {
|
||||||
glog.Errorf("Release doFlush %s: %v", fh.f.Name, err)
|
glog.Errorf("Release doFlush %s: %v", fh.f.Name, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stop the goroutine
|
||||||
|
if !fh.dirtyPages.chunkSaveErrChanClosed {
|
||||||
|
fh.dirtyPages.chunkSaveErrChanClosed = true
|
||||||
|
close(fh.dirtyPages.chunkSaveErrChan)
|
||||||
|
}
|
||||||
|
|
||||||
fh.f.wfs.ReleaseHandle(fh.f.fullpath(), fuse.HandleID(fh.handle))
|
fh.f.wfs.ReleaseHandle(fh.f.fullpath(), fuse.HandleID(fh.handle))
|
||||||
}
|
}
|
||||||
|
|
||||||
// stop the goroutine
|
|
||||||
if !fh.dirtyPages.chunkSaveErrChanClosed {
|
|
||||||
fh.dirtyPages.chunkSaveErrChanClosed = true
|
|
||||||
close(fh.dirtyPages.chunkSaveErrChan)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user