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

add NewNoStackError support #13

Merged
merged 1 commit into from
May 15, 2019
Merged

add NewNoStackError support #13

merged 1 commit into from
May 15, 2019

Conversation

lysu
Copy link
Collaborator

@lysu lysu commented May 15, 2019

problem

some errors are frequent throws and used to control program logic.

for example:

  • duplicate key error in database system
  • conflict to retry error

they should not get heavy stack every time, and we can guess error throw place by err msg for those case.

get those stack and print them log is waste

solution

add a NewNoStackError method, that error will use empty stack, later duplicate Trace call also NOT add stack for them.


This change is Reviewable

@coocood
Copy link
Member

coocood commented May 15, 2019

LGTM

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@coocood coocood merged commit cdf856f into pingcap:master May 15, 2019
SwanSpouse pushed a commit to SwanSpouse/errors that referenced this pull request Jul 14, 2019
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.

3 participants