diff --git a/buildscripts/race.sh b/buildscripts/race.sh index a83270965..2931342dc 100755 --- a/buildscripts/race.sh +++ b/buildscripts/race.sh @@ -6,5 +6,5 @@ export GORACE="history_size=7" export MINIO_API_REQUESTS_MAX=10000 for d in $(go list ./...); do - CGO_ENABLED=1 go test -v -race -short --timeout 100m "$d" + CGO_ENABLED=1 go test -v -race --timeout 100m "$d" done diff --git a/cmd/object-api-errors.go b/cmd/object-api-errors.go index 62806ff31..2439a1554 100644 --- a/cmd/object-api-errors.go +++ b/cmd/object-api-errors.go @@ -751,6 +751,12 @@ func isErrSignatureDoesNotMatch(err error) bool { return errors.As(err, &signatureDoesNotMatch) } +// isErrObjectNameInvalid - Check if error type is ObjectNameInvalid. +func isErrObjectNameInvalid(err error) bool { + var invalidObject ObjectNameInvalid + return errors.As(err, &invalidObject) +} + // PreConditionFailed - Check if copy precondition failed type PreConditionFailed struct{} diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index e5ac51a2d..374ceeca0 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -502,7 +502,7 @@ func (api objectAPIHandlers) getObjectHandler(ctx context.Context, objectAPI Obj perr error ) // avoid proxying if version is a delete marker - if !isErrMethodNotAllowed(err) && !(gr != nil && gr.ObjInfo.DeleteMarker) { + if !isErrObjectNameInvalid(err) && !isErrMethodNotAllowed(err) && !(gr != nil && gr.ObjInfo.DeleteMarker) { proxytgts := getProxyTargets(ctx, bucket, object, opts) if !proxytgts.Empty() { globalReplicationStats.incProxy(bucket, getObjectAPI, false) @@ -1028,7 +1028,7 @@ func (api objectAPIHandlers) headObjectHandler(ctx context.Context, objectAPI Ob objInfo, err := getObjectInfo(ctx, bucket, object, opts) var proxy proxyResult - if err != nil && !objInfo.DeleteMarker && !isErrMethodNotAllowed(err) { + if err != nil && !objInfo.DeleteMarker && !isErrMethodNotAllowed(err) && !isErrObjectNameInvalid(err) { // proxy HEAD to replication target if active-active replication configured on bucket proxytgts := getProxyTargets(ctx, bucket, object, opts) if !proxytgts.Empty() {