mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
fix(durable): cancel takeover cooling when provider closes
This commit is contained in:
1 parent
dbfa9424ae
commit
271b98eb2c
1 file changed
+4
@@ -328,6 +328,10 @@ func (p *DurableProvider) startChunkLoop(volumeID string, h *volHandle, layer st
|
||||
}
|
||||
|
||||
func (p *DurableProvider) newChunkLayer(ctx context.Context, volumeID string, h *volHandle) (storage.ChunkLayer, error) {
|
||||
// Close cancels local takeover cooling as well as each bound remote RPC.
|
||||
ctx, cancelAttach := context.WithCancel(ctx)
|
||||
stopClose := context.AfterFunc(p.closeCtx, cancelAttach)
|
||||
defer func() { stopClose(); cancelAttach() }()
|
||||
ws, ok := h.storage.(*storage.WALStore)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("durable: %s storage is %T, not a walstore", ImplWALStoreChunk, h.storage)
|
||||
|
||||
Reference in new issue
Block a user