mirror of
https://github.com/minio/minio.git
synced 2025-04-19 02:05:24 -04:00
remove MINIO_IO_DEADLINE support (#11841)
this feature in actual deployment was found to be not that useful, remove support for this for now.
This commit is contained in:
parent
94ff624242
commit
9a6487319a
@ -23,11 +23,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"hash"
|
"hash"
|
||||||
"io"
|
"io"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
"github.com/minio/minio/pkg/env"
|
|
||||||
xioutil "github.com/minio/minio/pkg/ioutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type errHashMismatch struct {
|
type errHashMismatch struct {
|
||||||
@ -73,21 +70,12 @@ func (b *streamingBitrotWriter) Close() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
|
||||||
ioDeadline, _ = time.ParseDuration(env.Get("MINIO_IO_DEADLINE", ""))
|
|
||||||
)
|
|
||||||
|
|
||||||
// Returns streaming bitrot writer implementation.
|
// Returns streaming bitrot writer implementation.
|
||||||
func newStreamingBitrotWriter(disk StorageAPI, volume, filePath string, length int64, algo BitrotAlgorithm, shardSize int64, heal bool) io.Writer {
|
func newStreamingBitrotWriter(disk StorageAPI, volume, filePath string, length int64, algo BitrotAlgorithm, shardSize int64, heal bool) io.Writer {
|
||||||
r, w := io.Pipe()
|
r, w := io.Pipe()
|
||||||
h := algo.New()
|
h := algo.New()
|
||||||
|
|
||||||
var wc io.WriteCloser = w
|
bw := &streamingBitrotWriter{w, h, shardSize, make(chan struct{})}
|
||||||
if ioDeadline > 0 && !heal {
|
|
||||||
wc = xioutil.NewDeadlineWriter(w, ioDeadline)
|
|
||||||
}
|
|
||||||
|
|
||||||
bw := &streamingBitrotWriter{wc, h, shardSize, make(chan struct{})}
|
|
||||||
go func() {
|
go func() {
|
||||||
totalFileSize := int64(-1) // For compressed objects length will be unknown (represented by length=-1)
|
totalFileSize := int64(-1) // For compressed objects length will be unknown (represented by length=-1)
|
||||||
if length != -1 {
|
if length != -1 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user