Commit 1e55d36b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent aa963178
......@@ -354,19 +354,19 @@ func (node *_MasteredNode) WithState(f func(cs *xneo.ClusterState) error) {
// The cluster state is guaranteed not to change during f run.
func (node *_MasteredNode) WithOperationalState(ctx context.Context, f func(mlink *neonet.NodeLink, s *xneo.State) error) error {
for {
done := false
var err error
var waitReady chan struct{}
node.WithState(func(s *xneo.State) {
if !s.operational {
ready = node.opReady
waitReady = node.opReady
return
}
//fmt.Printf("withOperation -> ready\n");
done = true
err = f(/*XXX -> s.mlink ?*/node.mlink, s)
})
if done {
if waitReady == nil {
return err
}
......@@ -386,7 +386,7 @@ func (node *_MasteredNode) WithOperationalState(ctx context.Context, f func(mlin
case <-ctx.Done():
return fmt.Errorf("wait operational: %w", ctx.Err())
case <-ready:
case <-waitReady:
// ok - try to relock and read again.
}
}
......
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