Commit 10c96fc9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 34369a7b
......@@ -673,11 +673,22 @@ def watch(w, zf, at): # XXX -> ?
# changed > at.
ctx, cancel = context.with_cancel(context.background())
wg = sync.WorkGroup(ctx)
def _(ctx):
pinv = w._expectPin(ctx, zf, pinok)
for p in pinv:
p.reply(b"ack") # XXX -> return to caller?
# check that we don't get extra pin notifications before "ok" to "watch"
try:
req = w.recvReq(ctx)
except Exception as e:
if e is context.canceled:
return # cancel is expected after seeing "ok"
reraise(e, None, e.__traceback__)
assert False, "extra pin message received: %r" % req.msg
wg.go(_)
def _(ctx):
assert w.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at))) == "ok"
# cancel _expectPin waiting upon receiving "ok" from wcfs
......
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