Commit 0fdf4c40 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bb5aa1ec
......@@ -1047,29 +1047,6 @@ func (m *Master) updateNodeState(ctx context.Context, peer *xneo.PeerNode, state
m.updateNodeTab(ctx, nodei)
}
// notifyAll notifies all peers about δstate event.
// XXX move close to _MasteredPeer.notify
func (m *Master) notifyAll(ctx context.Context, event _ΔClusterState) {
for nid, peer := range m.peerTab {
// TODO change limiting by buffer size to limiting by time -
// - i.e. detach peer if event queue grows more than 30s of time.
select {
case peer.notifyq <- event:
continue // ok
default:
}
// XXX try to move logging into other place - so that we could remove ctx arg here
log.Warningf(ctx, "peer %s is slow -> detaching it", nid)
close(peer.notifyqOverflow)
// TODO delete(m.peerTab, nid) -> p.cancel()
// XXX what else?
panic("TODO")
}
}
// ----------------------------------------
// identify processes identification request of just connected node and either accepts or declines it.
......@@ -1271,6 +1248,27 @@ func (p *_MasteredPeer) accept(ctx context.Context) (err error) {
return nil
}
// notifyAll notifies all peers about δstate event.
func (m *Master) notifyAll(ctx context.Context, event _ΔClusterState) {
for nid, peer := range m.peerTab {
// TODO change limiting by buffer size to limiting by time -
// - i.e. detach peer if event queue grows more than 30s of time.
select {
case peer.notifyq <- event:
continue // ok
default:
}
// XXX try to move logging into other place - so that we could remove ctx arg here
log.Warningf(ctx, "peer %s is slow -> detaching it", nid)
close(peer.notifyqOverflow)
// TODO delete(m.peerTab, nid) -> p.cancel()
// XXX what else?
panic("TODO")
}
}
// notify proxies δnodeTab/δpartTab/δClusterState update to the peer.
func (p *_MasteredPeer) notify(ctx context.Context) (err error) {
defer task.Runningf(&ctx, "notify %s", p.node.NID)(&err)
......
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