mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -05:00
xl: CreateFile shouldn't prematurely timeout (#11854)
For large objects taking more than '3 minutes' response times in a single PUT operation can timeout prematurely as 'ResponseHeader' timeout hits for 3 minutes. Avoid this by keeping the connection active during CreateFile phase.
This commit is contained in:
parent
726d80dbb7
commit
922c7b57f5
@ -44,7 +44,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
dataScannerSleepPerFolder = time.Millisecond // Time to wait between folders.
|
dataScannerSleepPerFolder = time.Millisecond // Time to wait between folders.
|
||||||
dataScannerStartDelay = 1 * time.Minute // Time to wait on startup and between cycles.
|
dataScannerStartDelay = 5 * time.Minute // Time to wait on startup and between cycles.
|
||||||
dataUsageUpdateDirCycles = 16 // Visit all folders every n cycles.
|
dataUsageUpdateDirCycles = 16 // Visit all folders every n cycles.
|
||||||
|
|
||||||
healDeleteDangling = true
|
healDeleteDangling = true
|
||||||
|
@ -337,8 +337,10 @@ func (client *storageRESTClient) CreateFile(ctx context.Context, volume, path st
|
|||||||
values.Set(storageRESTFilePath, path)
|
values.Set(storageRESTFilePath, path)
|
||||||
values.Set(storageRESTLength, strconv.Itoa(int(size)))
|
values.Set(storageRESTLength, strconv.Itoa(int(size)))
|
||||||
respBody, err := client.call(ctx, storageRESTMethodCreateFile, values, ioutil.NopCloser(reader), size)
|
respBody, err := client.call(ctx, storageRESTMethodCreateFile, values, ioutil.NopCloser(reader), size)
|
||||||
defer http.DrainBody(respBody)
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
}
|
||||||
|
return waitForHTTPStream(respBody, ioutil.Discard)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *storageRESTClient) WriteMetadata(ctx context.Context, volume, path string, fi FileInfo) error {
|
func (client *storageRESTClient) WriteMetadata(ctx context.Context, volume, path string, fi FileInfo) error {
|
||||||
|
@ -287,10 +287,10 @@ func (s *storageRESTServer) CreateFileHandler(w http.ResponseWriter, r *http.Req
|
|||||||
s.writeErrorResponse(w, err)
|
s.writeErrorResponse(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = s.storage.CreateFile(r.Context(), volume, filePath, int64(fileSize), r.Body)
|
|
||||||
if err != nil {
|
done := keepHTTPResponseAlive(w)
|
||||||
s.writeErrorResponse(w, err)
|
done(s.storage.CreateFile(r.Context(), volume, filePath, int64(fileSize), r.Body))
|
||||||
}
|
w.(http.Flusher).Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteVersion delete updated metadata.
|
// DeleteVersion delete updated metadata.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user