Browse Source

avoid closing chunkSaveErrChan too early

pull/1598/head
Chris Lu 4 years ago
parent
commit
a9662d44ac
  1. 7
      weed/filesys/filehandle.go

7
weed/filesys/filehandle.go

@ -183,11 +183,10 @@ 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)
} }
fh.f.wfs.ReleaseHandle(fh.f.fullpath(), fuse.HandleID(fh.handle))
}
// stop the goroutine // stop the goroutine
if !fh.dirtyPages.chunkSaveErrChanClosed { if !fh.dirtyPages.chunkSaveErrChanClosed {
@ -195,6 +194,10 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err
close(fh.dirtyPages.chunkSaveErrChan) close(fh.dirtyPages.chunkSaveErrChan)
} }
fh.f.wfs.ReleaseHandle(fh.f.fullpath(), fuse.HandleID(fh.handle))
}
return nil return nil
} }

Loading…
Cancel
Save