-
Notifications
You must be signed in to change notification settings - Fork 721
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
controller: avoid the invalid nil pointer #6486
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: nolouch <nolouch@gmail.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #6486 +/- ##
==========================================
+ Coverage 75.03% 75.07% +0.04%
==========================================
Files 410 410
Lines 41823 41858 +35
==========================================
+ Hits 31380 31424 +44
+ Misses 7698 7687 -11
- Partials 2745 2747 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
return group.RawResourceSettings.IoWrite | ||
} | ||
return nil | ||
} | ||
|
||
func add(custom1 *rmpb.Consumption, custom2 *rmpb.Consumption) { | ||
if custom1 == nil || custom2 == nil { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it reasonable to return the non-nil one and only return nothing when both are nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not getting your point. It's reasonable to return once it has nil in here I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, if custom1
is nil and custom2
is not, we can simply return custom2
instead of a nil value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means if custom1 is nil, we can return custom2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some misunderstanding here. this function no return values, just exit the function call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
Signed-off-by: nolouch <nolouch@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible nil consumption occur inKVCalculator
?
rest LGTM.
Signed-off-by: nolouch <nolouch@gmail.com>
Done @CabinfeverB |
@HuSharp: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 08db261
|
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: Close #6485
What is changed and how does it work?
Check List
Tests
ref case Hit connection running loop panic in tidb when do patrol check in serverless prod env #6485
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note