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

statistics: fix panic when getStatsReader fail #15651

Merged
merged 3 commits into from
Mar 26, 2020

Conversation

winoros
Copy link
Member

@winoros winoros commented Mar 24, 2020

What problem does this PR solve?

The defer func is not placed correctly. Thus it would panic in some cases.

What is changed and how it works?

Check the error before the defer func. Avoid potential panic.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

@winoros winoros requested a review from a team as a code owner March 24, 2020 18:20
@ghost ghost requested review from francis0407 and lzmhhh123 and removed request for a team March 24, 2020 18:20
@codecov
Copy link

codecov bot commented Mar 24, 2020

Codecov Report

Merging #15651 into master will not change coverage by %.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #15651   +/-   ##
===========================================
  Coverage   80.4843%   80.4843%           
===========================================
  Files           504        504           
  Lines        134584     134584           
===========================================
  Hits         108319     108319           
  Misses        17784      17784           
  Partials       8481       8481           

@zz-jason
Copy link
Member

How did you find this bug?

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 25, 2020
@winoros
Copy link
Member Author

winoros commented Mar 25, 2020

@zz-jason It's reported by @mahjonp .

Copy link
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

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

LGTM

@lzmhhh123 lzmhhh123 added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 25, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 25, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Mar 25, 2020

@winoros merge failed.

@winoros
Copy link
Member Author

winoros commented Mar 26, 2020

/run-integration-common-test

@winoros winoros merged commit 2846f5c into pingcap:master Mar 26, 2020
@winoros winoros deleted the stats-fix-panic branch March 26, 2020 05:16
sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Mar 26, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 26, 2020

cherry pick to release-3.0 in PR #15709

sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Mar 26, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 26, 2020

cherry pick to release-3.1 in PR #15710

@sre-bot
Copy link
Contributor

sre-bot commented Mar 26, 2020

cherry pick to release-4.0 in PR #15711

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants