Commit 73b9c447 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e9af596e
...@@ -183,6 +183,7 @@ func (c *Client) updateOperational() (sendReady func()) { ...@@ -183,6 +183,7 @@ func (c *Client) updateOperational() (sendReady func()) {
// //
// The only error possible is if provided ctx cancels. // The only error possible is if provided ctx cancels.
// XXX and client stopped/closed? (ctx passed to Run cancelled) // XXX and client stopped/closed? (ctx passed to Run cancelled)
// XXX change signature to call f from under withOperational ?
func (c *Client) withOperational(ctx context.Context) error { func (c *Client) withOperational(ctx context.Context) error {
for { for {
c.node.StateMu.RLock() c.node.StateMu.RLock()
...@@ -314,14 +315,15 @@ func (c *Client) recvMaster1(ctx context.Context, req neonet.Request) error { ...@@ -314,14 +315,15 @@ func (c *Client) recvMaster1(ctx context.Context, req neonet.Request) error {
c.node.StateMu.Unlock() c.node.StateMu.Unlock()
return fmt.Errorf("unexpected message: %T", msg) return fmt.Errorf("unexpected message: %T", msg)
// M sends whole PT // <- whole partTab
case *proto.SendPartitionTable: case *proto.SendPartitionTable:
c.node.UpdatePartTab(ctx, msg) c.node.UpdatePartTab(ctx, msg)
// M sends δPT // <- δ(partTab)
//case *proto.NotifyPartitionChanges: case *proto.NotifyPartitionChanges:
// TODO panic("TODO δ(partTab)")
// <- δ(nodeTab)
case *proto.NotifyNodeInformation: case *proto.NotifyNodeInformation:
c.node.UpdateNodeTab(ctx, msg) c.node.UpdateNodeTab(ctx, msg)
......
...@@ -299,7 +299,7 @@ func (app *NodeApp) UpdateNodeTab(ctx context.Context, msg *proto.NotifyNodeInfo ...@@ -299,7 +299,7 @@ func (app *NodeApp) UpdateNodeTab(ctx context.Context, msg *proto.NotifyNodeInfo
app.NodeTab.Update(nodeInfo) app.NodeTab.Update(nodeInfo)
// XXX we have to provide IdTime when requesting identification to other peers // XXX we have to provide IdTime when requesting identification to other peers
// (e.g. Spy checks this is what master broadcast them and if not replis "unknown by master") // (e.g. Spy checks this is what master broadcast them and if not replies "unknown by master")
if nodeInfo.UUID == app.MyInfo.UUID { if nodeInfo.UUID == app.MyInfo.UUID {
// XXX recheck locking // XXX recheck locking
// XXX do .MyInfo = nodeInfo ? // XXX do .MyInfo = nodeInfo ?
......
...@@ -148,6 +148,8 @@ func (nt *NodeTable) Update(nodeInfo proto.NodeInfo) *Node { ...@@ -148,6 +148,8 @@ func (nt *NodeTable) Update(nodeInfo proto.NodeInfo) *Node {
} }
*/ */
// XXX close link if .state becomes DOWN ?
traceNodeChanged(nt, node) traceNodeChanged(nt, node)
nt.notify(node.NodeInfo) nt.notify(node.NodeInfo)
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"""runneo.py runs NEO/py cluster for NEO/go testing. """runneo.py runs NEO/py cluster for NEO/go testing.
Usage: runneo.py <workdir> <cluster-name> XXX + (**kw for NEOCluster) Usage: runneo.py <workdir> <cluster-name> XXX + (**kw for NEOCluster)
<workdir>/ready is created with address of master after spawned cluster becomes
operational.
""" """
from neo.tests.functional import NEOCluster from neo.tests.functional import NEOCluster
...@@ -61,11 +64,9 @@ def main(): ...@@ -61,11 +64,9 @@ def main():
os.unlink(readyf) os.unlink(readyf)
defer(_) defer(_)
while 1: while 1:
sleep(1) sleep(1)
if __name__ == '__main__': if __name__ == '__main__':
main() main()
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