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

fix potential panic when read last line #31

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

crazycs520
Copy link
Collaborator

Signed-off-by: crazycs chen.two.cs@gmail.com

Close issue: #29

This PR does 2 things:

  1. fix potential panic when read log last line.
  2. add recover to avoid process exit cause by search log panic.

Signed-off-by: crazycs <chen.two.cs@gmail.com>
@crazycs520
Copy link
Collaborator Author

@baurine @lonng PTAL

buf = buf[:stackSize]
err = fmt.Errorf(fmt.Sprintf("search log panic, %v, stack is %v", r, string(buf)))
log.Error(err.Error())
}
Copy link
Member

Choose a reason for hiding this comment

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

Should we return err to the outside?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The error already returns to the outside since line 47 assign value to err.

Copy link
Member

@breezewish breezewish left a comment

Choose a reason for hiding this comment

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

The rest LGTM. Remember to upgrade the sysutil for each branch.

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.

2 participants