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

Enhancement: Make s3 backend readError logic more robust #905

Merged
merged 9 commits into from
Aug 27, 2021

Conversation

wei840222
Copy link
Contributor

for some s3 compatible storage backend, it may has differnt error messsage when object not exist.
I think using minio.error code for judge the object is not exist is more robust.

@CLAassistant
Copy link

CLAassistant commented Aug 24, 2021

CLA assistant check
All committers have signed the CLA.

@wei840222 wei840222 changed the title Enhancement: make s3 backend readError logic more robust Enhancement: Make s3 backend readError logic more robust Aug 24, 2021
Copy link
Member

@mapno mapno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for the contribution. Is there any difference between the current check err.Error() == s3KeyDoesNotExist and checking the error code for the same 'no key' error? It's being checked in both modified methods.

tempodb/backend/s3/s3.go Outdated Show resolved Hide resolved
@mapno
Copy link
Member

mapno commented Aug 24, 2021

Sorry, I re-read your description and saw the explanation for some s3 compatible storage backend, it may has different error message . Then, would it make sense to just check the code?

@wei840222
Copy link
Contributor Author

I think it is make sense to just check the code.
If possible, I can submit another commit to make corrections.

@wei840222
Copy link
Contributor Author

wei840222 commented Aug 24, 2021

@mapno I've changed.

@wei840222 wei840222 requested a review from mapno August 26, 2021 02:49
Copy link
Member

@mapno mapno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice!

@wei840222
Copy link
Contributor Author

It seems need approved for run CI.

@joe-elliott
Copy link
Member

Thanks for the contribution, wei. We will wait til we cut 1.1 to merge.

@wei840222
Copy link
Contributor Author

Got it, thx

@mapno mapno merged commit f26fac1 into grafana:main Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants