increase event handling buffer
this should mitigate a timing issue where joining larger clusters would cause cluster.members() to deadlock.
This commit is contained in:
parent
98b85ff318
commit
a46d8ac18d
|
@ -101,8 +101,10 @@ func newCluster(config *config, wg *wgState) (*cluster, error) {
|
||||||
localName: ml.LocalNode().Name,
|
localName: ml.LocalNode().Name,
|
||||||
ml: ml,
|
ml: ml,
|
||||||
wg: wg,
|
wg: wg,
|
||||||
events: make(chan memberlist.NodeEvent, 1),
|
// The big channel buffer is a work-around for https://github.com/hashicorp/memberlist/issues/23
|
||||||
state: state,
|
// More than this many simultaneous events will deadlock cluster.members()
|
||||||
|
events: make(chan memberlist.NodeEvent, 100),
|
||||||
|
state: state,
|
||||||
}
|
}
|
||||||
mlConfig.Conflict = &cluster
|
mlConfig.Conflict = &cluster
|
||||||
mlConfig.Events = &memberlist.ChannelEventDelegate{Ch: cluster.events}
|
mlConfig.Events = &memberlist.ChannelEventDelegate{Ch: cluster.events}
|
||||||
|
|
Loading…
Reference in New Issue