mirror of
https://github.com/minio/minio.git
synced 2025-11-06 20:33:07 -05:00
Make sure to close the disk connections (#5752)
Since we do not re-use storageDisks after moving the connections to object layer we should close them appropriately otherwise we have a lot of connection leaks and these can compound as the time goes by. This PR also refactors the initialization code to re-use storageDisks for given set of endpoints until we have confirmed a valid reference format.
This commit is contained in:
committed by
Nitish Tiwari
parent
d67e423a32
commit
85a57d2021
@@ -59,14 +59,7 @@ var xlTreeWalkIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied, errVolu
|
||||
// Shutdown function for object storage interface.
|
||||
func (xl xlObjects) Shutdown(ctx context.Context) error {
|
||||
// Add any object layer shutdown activities here.
|
||||
for _, disk := range xl.getDisks() {
|
||||
// This closes storage rpc client connections if any.
|
||||
// Otherwise this is a no-op.
|
||||
if disk == nil {
|
||||
continue
|
||||
}
|
||||
disk.Close()
|
||||
}
|
||||
closeStorageDisks(xl.getDisks())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user