-
Notifications
You must be signed in to change notification settings - Fork 726
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
Errors add stack #1246
Errors add stack #1246
Conversation
I think the way we solve this problem is more straightforward - simply not wap stack multiple times for an error, so there is no need to introduce the complexity of AddStack. |
Why do you say that this is complex? The API is the same. We are considering |
errors.AddStack is now available on our fork. It ensures that duplicate stack traces will not be created.
1bf1c64
to
d55f76b
Compare
It is fine to continue with the approach of manually auditing stack additions after merging this. This will end up providing some extra safety. I think that probably in the long term the code should be changed so that there is little usage of |
What I mean about "complexity" is that pingcap/errors has unnecessary complexity relative to pkg/errors. In particular, I really don't like the idea of "wrapping pkg/errors to make its interface the same as juju/errors". For now, using pkg/errors directly is simple and effective. It is easier for people who are already familiar with pkg/errors to understand and get started. I hope to use pkg/errors directly. |
I agree that we should not be wrapping pkg/errors just for the purpose of providing compatibility with juju/errors. I disagree that pkg/errors is simple and effective right now. The behavior of several APIs is unexpected ( |
Sorry not LGTM. The In the end, we may have to pick one from |
That's a good point that I think the mental burden argument has been mis-calculated. Right now there is a choice between |
So do you suggest that we use It seems that it is hard to reach an agreement here. We may want to use some thoughts from you guys. /cc @siddontang @nolouch @rleungx |
Yes, that is my suggestion. I would like to standardize on best practices across tidb. pd and tidb differ now. But these error handling APIs are new, so we can revisit this issue after gaining more experience with them. |
What problem does this PR solve?
This ensures that duplicate stack traces will not be created.
What is changed and how it works?
use errors.AddStack for stack trace de-duping
errors.AddStack is now available on our fork.
upgrade to pingcap/errors 0.9.0
Check List
No change to functionality or API. Tests and checks should pass the same.
Performance should be the same, but is now guaranteed to not get worse.