Commit 824b7544 authored by ale's avatar ale

Fixed a logic error when merging remote updates in the status protocol

parent 441853b0
Pipeline #2721 passed with stages
in 4 minutes and 12 seconds
......@@ -138,13 +138,14 @@ func (m *statusManager) propagateStatus(ctx context.Context) error {
}
func (m *statusManager) mergeRemoteStatuses(remote []*pb.Status) {
if m.self != nil {
remote = withoutNode(remote, m.self.Name)
if len(remote) == 0 {
return
}
s := []*pb.Status{m.self}
if len(remote) > 0 {
adds := mergeNodes(m.statuses, remote)
s = append(s, adds...)
s := mergeNodes(m.statuses, remote)
if m.self != nil {
s = withoutNode(s, m.self.Name)
s = append([]*pb.Status{m.self}, s...)
}
m.statuses = s
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment