Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
fd68aad2
Commit
fd68aad2
authored
Jun 27, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
03523e08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
wcfs/wcfs.go
wcfs/wcfs.go
+3
-2
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+20
-2
No files found.
wcfs/wcfs.go
View file @
fd68aad2
...
...
@@ -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
"
)
}
...
...
wcfs/wcfs_test.py
View file @
fd68aad2
...
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment