Skip to content

Commit

Permalink
control: set the highest priority for control service.
Browse files Browse the repository at this point in the history
Control ports should be initialised and start served first of all. As
initControlService already listening endpoint, no need of preRun of
control service.

Closes: #2585.

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed Nov 16, 2023
1 parent f865d17 commit b9c1a5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Changelog for NeoFS Node
- New optimized SDK version is integrated (#2622)
- IR uses internal LOCODE DB from Go package (#2610)
- Contract group for the committee is no longer registered/used in the Sidechain auto-deployment (#2642)
- The priority of running control service is increased (#2585)

### Removed
- deprecated `no-precheck` flag of `neofs-cli container set-eacl` (#2496)
Expand Down
7 changes: 4 additions & 3 deletions cmd/neofs-node/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ func initControlService(c *cfg) {
})

control.RegisterControlServiceServer(c.cfgControlService.server, ctlSvc)

c.workers = append(c.workers, newWorkerFromFunc(func(ctx context.Context) {
c.wg.Add(1)
go func() {
runAndLog(c, "control", false, func(c *cfg) {
fatalOnErr(c.cfgControlService.server.Serve(lis))
c.wg.Done()
})
}))
}()
}

func (c *cfg) NetmapStatus() control.NetmapStatus {
Expand Down
2 changes: 1 addition & 1 deletion cmd/neofs-node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func initAndLog(c *cfg, name string, initializer func(*cfg)) {
}

func initApp(c *cfg) {
initAndLog(c, "control", initControlService)
initLocalStorage(c)

c.ctx, c.ctxCancel = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
Expand All @@ -99,7 +100,6 @@ func initApp(c *cfg) {
initAndLog(c, "pprof", initProfiler)
initAndLog(c, "prometheus", initMetrics)
initAndLog(c, "tree", initTreeService)
initAndLog(c, "control", initControlService)

initAndLog(c, "morph notifications", listenMorphNotifications)

Expand Down

0 comments on commit b9c1a5b

Please sign in to comment.