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

Ability to kill the Serve method #2760

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

OCharless
Copy link

Currently, the bgp server is running endlessly. It's goten shut down when the main program stops. This PR have as a purpose to supply an optional channel in order to stop gracefully the Serve method whenever it's needed.

@fujita
Copy link
Member

fujita commented Jan 29, 2024

Already supported:

rpc StopBgp(StopBgpRequest) returns(google.protobuf.Empty);

@saser
Copy link
Contributor

saser commented Jan 31, 2024

Also note that the BgpServer type has a Stop method that will call the StopBgp API method for you:

gobgp/pkg/server/server.go

Lines 219 to 225 in 815683f

func (s *BgpServer) Stop() {
s.StopBgp(context.Background(), &api.StopBgpRequest{})
if s.apiServer != nil {
s.apiServer.grpcServer.Stop()
}
}
. Just calling Stop() has been sufficient when I've used it.

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.

3 participants