mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
avoid close 'nil' panics if any (#18890)
brings a generic implementation that prints a stack trace for 'nil' channel closes(), if not safely closes it.
This commit is contained in:
@@ -491,7 +491,7 @@ func (s *xlStorage) NSScanner(ctx context.Context, cache dataUsageCache, updates
|
||||
}()
|
||||
|
||||
// Updates must be closed before we return.
|
||||
defer close(updates)
|
||||
defer xioutil.SafeClose(updates)
|
||||
var lc *lifecycle.Lifecycle
|
||||
|
||||
// Check if the current bucket has a configured lifecycle policy
|
||||
@@ -2803,7 +2803,7 @@ func (s *xlStorage) VerifyFile(ctx context.Context, volume, path string, fi File
|
||||
// The resp channel is closed before the call returns.
|
||||
// Only a canceled context will return an error.
|
||||
func (s *xlStorage) ReadMultiple(ctx context.Context, req ReadMultipleReq, resp chan<- ReadMultipleResp) error {
|
||||
defer close(resp)
|
||||
defer xioutil.SafeClose(resp)
|
||||
|
||||
volumeDir := pathJoin(s.drivePath, req.Bucket)
|
||||
found := 0
|
||||
|
||||
Reference in New Issue
Block a user