-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
tidb-server, terror: add cleanup when createServer
exits abnormally
#6947
Conversation
terror/terror.go
Outdated
@@ -328,6 +328,14 @@ func MustNil(err error) { | |||
} | |||
} | |||
|
|||
// CleanNotNil cleans up and fatals if err is not 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.
Why put it in the terror package?
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.
Becuase MustNil
is here.
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.
How about we reuse the MustNil
function, and change it like
func MustNil(err error, closeFn ...func())
rest LGTM |
/run-all-tests |
tidb-server/main.go
Outdated
@@ -487,11 +488,15 @@ func runServer() { | |||
} | |||
} | |||
|
|||
func close() { |
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.
s/close/closeDomainAndStoreage/
LGTM |
/run-all-tests |
Do not forget to attach labels to your PR and cherry-pick this to the release-2.0 branch. |
@coocood @tiancaiamao PTAL |
LGTM |
…pingcap#6947) * tidb-server, terror: add cleanup in createServer
What have you changed? (mandatory)
Handle #6946
What are the type of the changes (mandatory)?
How has this PR been tested (mandatory)?
Before this PR:
After this PR: