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:
Harshavardhana 2021-03-20 02:47:04 -07:00 committed by GitHub
parent 94ff624242
commit 9a6487319a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {