Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileservice: more logs for debugging EOF in Write #21285

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/fileservice/aliyun_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (a *AliyunSDK) Exists(
if a.is404(err) {
return false, nil
}
return false, err
return false, wrapError("AliyunSDK.Exists", err)
}

return true, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/fileservice/aws_sdk_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (a *AwsSDKv2) Exists(
return false, nil
}
}
return false, err
return false, wrapError("AwsSDKv2.Exists", err)
}
return output != nil, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/fileservice/disk_object_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (d *diskObjectStorage) Exists(ctx context.Context, key string) (bool, error
if os.IsNotExist(err) {
return false, nil
}
return false, err
return false, wrapError("diskObjectStorage.Exists", err)
}
return true, nil
}
Expand Down
22 changes: 22 additions & 0 deletions pkg/fileservice/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,25 @@ func isDiskFull(err error) bool {
str := err.Error()
return strings.Contains(str, "disk quota exceeded")
}

type errorWrap struct {
what string
err error
}

var _ error = errorWrap{}

func (e errorWrap) Error() string {
return e.what + ": " + e.err.Error()
}

func (e errorWrap) Unwrap() error {
return e.err
}

func wrapError(what string, err error) errorWrap {
return errorWrap{
what: what,
err: err,
}
}
2 changes: 1 addition & 1 deletion pkg/fileservice/minio_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (a *MinioSDK) Exists(
if a.is404(err) {
return false, nil
}
return false, err
return false, wrapError("MinioSDK.Exists", err)
}

return true, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/fileservice/qcloud_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (a *QCloudSDK) Exists(
if a.is404(err) {
return false, nil
}
return false, err
return false, wrapError("QCloudSDK.Exists", err)
}

return true, nil
Expand Down
Loading