Rework RPC server start process #1265

Open
opened 2025-12-28 17:15:49 +00:00 by sami · 0 comments
Owner

Originally created by @AnnaShaleva on GitHub (Feb 21, 2024).

After #3307 the only node service that requires from caller to send call to Start to a separate goroutine is RPC server. It's so special because it may return errors to the provided error channel, and the caller must start error channel by the moment of RPC server start:
nspcc-dev/neo-go@327e766cd9/cli/server/server.go (L503-L506)

One day it may cause a bug, because we always need to remember about this RPC server behaviour.

Describe the solution you'd like

Refactor RPC server start so that the caller is able to call Start in the same goroutine. Send code that may return errors to a separate goroutine inside Start.

Describe alternatives you've considered

Allow to return error from Start, but it'd be inconvenient since we have common Service interface and none of our services return error from start.

Originally created by @AnnaShaleva on GitHub (Feb 21, 2024). ## Is your feature request related to a problem? Please describe. After #3307 the only node service that requires from caller to send call to `Start` to a separate goroutine is RPC server. It's so special because it may return errors to the provided error channel, and the caller must start error channel by the moment of RPC server start: https://github.com/nspcc-dev/neo-go/blob/327e766cd92f4628093e331b7335ce626c2f9f2f/cli/server/server.go#L503-L506 One day it may cause a bug, because we always need to remember about this RPC server behaviour. ## Describe the solution you'd like Refactor RPC server start so that the caller is able to call `Start` in the same goroutine. Send code that may return errors to a separate goroutine inside `Start`. ## Describe alternatives you've considered Allow to return error from `Start`, but it'd be inconvenient since we have common `Service` interface and none of our services return error from start.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neo-go#1265
No description provided.