Skip to content

daemon: extract gRPC server startup into start_grpc_server()#533

Merged
fujita merged 5 commits into
osrg:masterfrom
fujita:refactor
Jun 22, 2026
Merged

daemon: extract gRPC server startup into start_grpc_server()#533
fujita merged 5 commits into
osrg:masterfrom
fujita:refactor

Conversation

@fujita

@fujita fujita commented Jun 21, 2026

Copy link
Copy Markdown
Member

Global::serve() has grown large and mixes the gRPC startup concern with the peer-accept loop. Extracting the spawn into a dedicated function separates the two responsibilities and makes each easier to follow.

fujita added 5 commits June 22, 2026 08:44
Global::serve() has grown large and mixes the gRPC startup concern
with the peer-accept loop. Extracting the spawn into a dedicated
function separates the two responsibilities and makes each easier
to follow.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
BGP was always bound to 0.0.0.0 and [::] regardless of any
local_address_list in the config file or listen_addresses in the
StartBgp gRPC request, making those settings ineffective.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
The gRPC API server address was hardcoded to 0.0.0.0:50051 with no
way to change it, preventing deployments that need to bind to a
specific interface or port.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
SessionAddrs and NegotiatedGr are only used within event/mod.rs and
do not need to be visible to sibling submodules.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
accept_connection and start_grpc_server were sandwiched between two
impl Global blocks, making the struct's methods harder to navigate.
Moving the free functions after the impl block unifies it.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
@fujita fujita merged commit 413e16d into osrg:master Jun 22, 2026
13 checks passed
@fujita fujita deleted the refactor branch June 22, 2026 00:19
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.

1 participant