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

server: return nil when server is closed #1397

Merged
merged 2 commits into from
Dec 26, 2018
Merged

server: return nil when server is closed #1397

merged 2 commits into from
Dec 26, 2018

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Dec 26, 2018

What problem does this PR solve?

Currently, when we stop PD, it will print the error stack which is confused even if there is only one PD.

2018/12/26 05:10:45.332 leader.go:116: [error] campaign leader err server closed
github.com/pingcap/pd/server.(*Server).campaignLeader
	/.../pd/server/leader.go:287
github.com/pingcap/pd/server.(*Server).leaderLoop
	/.../pd/server/leader.go:115
runtime.goexit
	/usr/local/go1.11.1/src/runtime/asm_amd64.s:1333

What is changed and how it works?

This PR fixes this problem. It will returns nil rather than an error when the server is closed in campaignLeader's loop.

Tests

  • Manual test

Signed-off-by: rleungx <rleungx@gmail.com>
@rleungx rleungx added the type/enhancement The issue belongs to an enhancement. label Dec 26, 2018
Copy link
Contributor

@siddontang siddontang left a comment

Choose a reason for hiding this comment

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

LGTM

@nolouch nolouch merged commit f037c74 into tikv:master Dec 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants