Skip to content

Commit 7ce383f

Browse files
(fix): handle nil shardorchestrator (#22591)
1 parent 63d7423 commit 7ce383f

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

core/services/cre/cre.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -977,12 +977,15 @@ func newWorkflowRegistrySyncerV2(
977977
if opts.ShardOrchestratorClient != nil {
978978
shardOrchestratorClient = opts.ShardOrchestratorClient
979979
} else {
980-
var c shardorchestrator.ClientInterface
981-
c, err = newShardOrchestratorClient(cfg, lggr)
982-
if err != nil {
983-
return nil, nil, err
980+
c, clientErr := newShardOrchestratorClient(cfg, lggr)
981+
if clientErr != nil {
982+
return nil, nil, clientErr
983+
}
984+
if c != nil {
985+
shardOrchestratorClient = c
986+
} else {
987+
lggr.Debugw("ShardOrchestrator client not created (shard 0 runs the server)")
984988
}
985-
shardOrchestratorClient = c
986989
}
987990

988991
shardingEnabled := cfg.Sharding().ShardingEnabled()

0 commit comments

Comments
 (0)