mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
fix: hanging operations on PUT with slow IO (#13087)
#11878 added "keepHTTPResponseAlive" to CreateFile requests. The problem is that it will begin writing to the response before the body is read after 10 seconds. This will abort the writes on the client-side, since it assumes the server has received what it wants. The proposed solution here is to monitor the completion of the body before beginning to send keepalive pings. Fixes observed high number of goroutines stuck in `io.Copy` in `github.com/minio/minio/cmd.(*xlStorage).CreateFile` and `(*storageRESTClient).CreateFile` stuck in `http.DrainBody`.
This commit is contained in:
@@ -57,6 +57,10 @@ func (b *streamingBitrotWriter) Write(p []byte) (int, error) {
|
||||
b.closeWithErr(err)
|
||||
return n, err
|
||||
}
|
||||
if n != len(p) {
|
||||
err = io.ErrShortWrite
|
||||
b.closeWithErr(err)
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user