Skip to content

Commit cd9d32c

Browse files
ti-chi-botrleungx
andauthored
server: fix the data race problem (#3772) (#3773)
* This is an automated cherry-pick of #3772 Signed-off-by: ti-chi-bot <[email protected]> * resolve conflicts Signed-off-by: Ryan Leung <[email protected]> Co-authored-by: Ryan Leung <[email protected]>
1 parent e649fe7 commit cd9d32c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/server.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1153,17 +1153,17 @@ func (s *Server) campaignLeader() {
11531153
log.Error("failed to reload configuration", errs.ZapError(err))
11541154
return
11551155
}
1156+
if err := s.persistOptions.LoadTTLFromEtcd(s.ctx, s.client); err != nil {
1157+
log.Error("failed to load persistOptions from etcd", errs.ZapError(err))
1158+
return
1159+
}
11561160
// Try to create raft cluster.
11571161
err = s.createRaftCluster()
11581162
if err != nil {
11591163
log.Error("failed to create raft cluster", errs.ZapError(err))
11601164
return
11611165
}
11621166
defer s.stopRaftCluster()
1163-
if err := s.persistOptions.LoadTTLFromEtcd(s.ctx, s.client); err != nil {
1164-
log.Error("failed to load persistOptions from etcd", errs.ZapError(err))
1165-
return
1166-
}
11671167
if err := s.idAllocator.Generate(); err != nil {
11681168
log.Error("failed to sync id from etcd", errs.ZapError(err))
11691169
return

0 commit comments

Comments
 (0)