satellite/metainfo: Close client DeleteObjectPieces

The DeleteObjectPieces must close the storage node client once it has
finished deleting its pieces.

Change-Id: I08eb8af8e4215d77d59b52f5055211b918374ab4
This commit is contained in:
Ivan Fraixedes 2020-01-08 15:01:34 +01:00
parent 082ec81714
commit 922c43f921
No known key found for this signature in database
GPG Key ID: 042B474597F96DB7

View File

@ -2399,6 +2399,14 @@ func (endpoint *Endpoint) DeleteObjectPieces(
// Pieces will be collected by garbage collector
return
}
defer func() {
err := client.Close()
endpoint.log.Warn("error closing the storage node client connection",
zap.Stringer("node_id", node.Id),
zap.Stringer("node_info", node),
zap.Error(err),
)
}()
for _, pieceID := range nodePieces {
err := client.DeletePiece(ctx, pieceID)