do not block on send channels under high load (#19090)

all send channels must compete with `ctx` if not
they will perpetually stay alive.
This commit is contained in:
Harshavardhana
2024-02-20 15:00:35 -08:00
committed by GitHub
parent c7f7c47388
commit 35deb1a8e2
4 changed files with 30 additions and 7 deletions

View File

@@ -937,7 +937,11 @@ func (er erasureObjects) getObjectFileInfo(ctx context.Context, bucket, object s
onlineDisks[i] = nil
}
mrfCheck <- fi.ShallowCopy()
select {
case mrfCheck <- fi.ShallowCopy():
case <-ctx.Done():
return fi, onlineMeta, onlineDisks, toObjectErr(ctx.Err(), bucket, object)
}
return fi, onlineMeta, onlineDisks, nil
}