Commit 7b4ae7bd authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a2ce1f4e
......@@ -84,7 +84,7 @@ func NewClient(clusterName, masterAddr string, net xnet.Networker) *Client {
}
// spawn background process which performs master talk
ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(context.Background()) // XXX bg hardcoded
cli.talkMasterCancel = cancel
cli.node.OnShutdown = cancel // XXX ok?
go cli.talkMaster(ctx)
......@@ -170,6 +170,7 @@ func (c *Client) updateOperational() (sendReady func()) {
// unlocked otherwise.
//
// The only error possible is if provided ctx cancel.
// XXX and client stopped/closed? (ctx passed to Run cancelled)
func (c *Client) withOperational(ctx context.Context) error {
for {
c.node.StateMu.RLock()
......@@ -186,6 +187,9 @@ func (c *Client) withOperational(ctx context.Context) error {
case <-ctx.Done():
return ctx.Err()
// XXX case <-c.runctx.Done():
// return "op on closed client ..." ?
case <-ready:
// ok - try to relock and read again.
}
......
......@@ -617,7 +617,8 @@ func TestMasterStorage(t *testing.T) {
// ----------------------------------------
// XXX try creating clint from the beginning
// XXX try creating client from the beginning
return // XXX temp
// create client
C := client.NewClient("abc1", "m:1", Chost)
......
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