Commit eea1a4f6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 897bd5a7
...@@ -227,7 +227,7 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func( ...@@ -227,7 +227,7 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
node.updateOperational(func() { node.updateOperational(func() {
err = node.updateNodeTab(ctx, &mnt) // the only err is cmdShutdown err = node.updateNodeTab(ctx, &mnt) // the only err is cmdShutdown
node.state.PartTab = pt node.state.PartTab = pt
if err != nil { if err == nil {
// keep mlink=nil on shutdown so that // keep mlink=nil on shutdown so that
// .operational does not change to y. // .operational does not change to y.
node.mlink = mlink node.mlink = mlink
...@@ -351,7 +351,7 @@ func (node *_MasteredNode) recvδstate(ctx context.Context, msg proto.Msg) (δpt ...@@ -351,7 +351,7 @@ func (node *_MasteredNode) recvδstate(ctx context.Context, msg proto.Msg) (δpt
} }
// updateOperational calls δf under .opMu and updates .operational from current state. // updateOperational calls δf under .opMu and updates .operational from current state.
// it also notifies those who was waiting for it if operational state becomes ready. // After .opMu unlock it also notifies those who was waiting for .operational to become y.
func (node *_MasteredNode) updateOperational(δf func()) { func (node *_MasteredNode) updateOperational(δf func()) {
var opready chan struct{} var opready chan struct{}
...@@ -362,9 +362,11 @@ func (node *_MasteredNode) updateOperational(δf func()) { ...@@ -362,9 +362,11 @@ func (node *_MasteredNode) updateOperational(δf func()) {
operational := (node.mlink != nil) && node.state.IsOperational() operational := (node.mlink != nil) && node.state.IsOperational()
//fmt.Printf("\nupdateOperatinal: %v\n", operational) fmt.Printf("\nupdateOperatinal: %v\n", operational)
//fmt.Println(node.partTab) fmt.Printf(" mlink: %s\n", node.mlink)
//fmt.Println(node.nodeTab) fmt.Printf(" state: %s\n", node.state.Code)
fmt.Printf(" partTab:\n%s", node.state.PartTab)
fmt.Printf(" nodeTab:\n%s", node.state.NodeTab)
if operational != node.operational { if operational != node.operational {
node.operational = operational node.operational = operational
......
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