Commit fd68aad2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 03523e08
......@@ -1420,9 +1420,10 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
}
// XXX check at >= w.at -> reject?
// check at >= w.at
// XXX we might want to allow going back in history if we need it.
if !(at >= w.at) {
panic("TODO")
return fmt.Errorf("going back ZZ history is forbidden")
}
......
......@@ -1379,6 +1379,26 @@ def test_wcfs_watch_before_create():
wl.close()
# verify that watch @at_i -> @at_j ↓ is rejected
# XXX we might want to allow going back in history.
@func
def test_wcfs_watch_going_back():
t = tDB(); zf = t.zfile
defer(t.close)
at1 = t.commit(zf, {2:'c1'})
at2 = t.commit(zf, {2:'c2'})
f = t.open(zf)
f.assertData(['','','c2'])
wl = t.openwatch()
wl.watch(zf, at2, {})
wl.sendReq(timeout(), b"watch %s @%s" % (h(zf._p_oid), h(at1))) == \
"error setup watch f<%s> @%s: " % (h(zf._p_oid), h(at1)) + \
"going back in history is forbidden"
wl.close()
# verify that wcfs kills slow/faulty client who does not reply to pin in time.
@xfail # protection against faulty/slow clients
@func
......@@ -1710,8 +1730,6 @@ def test_wcfs_watch_2files():
# XXX watch @at when file did not existed -> error
# XXX going not only up, but also down at1 <- at2 <- at3 ? -> forbid?
# XXX new watch request while previous watch request is in progress (over the same /head/watch handle)
......
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