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
4e8c3489
Commit
4e8c3489
authored
Dec 27, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cac15697
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
wcfs/wcfs.go
wcfs/wcfs.go
+12
-0
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+1
-0
No files found.
wcfs/wcfs.go
View file @
4e8c3489
...
...
@@ -533,6 +533,8 @@ func (root *Root) zwatcher(ctx context.Context) (err error) {
defer
xerr
.
Contextf
(
&
err
,
"zwatch"
)
// XXX more in context?
// XXX unmount on error? -> always EIO?
log
.
Info
(
"ZWatcher ..."
)
zwatchq
:=
make
(
chan
zodb
.
CommitEvent
)
root
.
zstor
.
AddWatch
(
zwatchq
)
defer
root
.
zstor
.
DelWatch
(
zwatchq
)
...
...
@@ -541,11 +543,15 @@ func (root *Root) zwatcher(ctx context.Context) (err error) {
var
ok
bool
for
{
log
.
Info
(
"."
)
select
{
case
<-
ctx
.
Done
()
:
log
.
Info
(
"cancel"
)
return
ctx
.
Err
()
case
zevent
,
ok
=
<-
zwatchq
:
log
.
Info
(
"event"
)
if
!
ok
{
return
nil
// closed XXX ok?
}
...
...
@@ -557,6 +563,7 @@ func (root *Root) zwatcher(ctx context.Context) (err error) {
// zhandle1 handles 1 event from ZODB notification.
func
(
root
*
Root
)
zhandle1
(
zevent
zodb
.
CommitEvent
)
{
log
.
Infof
(
"zwatcher: handle: %s"
,
zevent
)
// while we are invalidating OS cache, make sure that nothing, that
// even reads /head/bigfile/*, is running (see 4.6).
root
.
head
.
zconnMu
.
Lock
()
...
...
@@ -1287,6 +1294,11 @@ func main() {
Node
:
newDefaultNode
(),
})
// XXX place = ok?
// XXX ctx = ok?
// XXX wait for zwatcher shutdown.
go
root
.
zwatcher
(
ctx
)
// TODO handle autoexit
_
=
autoexit
...
...
wcfs/wcfs_test.py
View file @
4e8c3489
...
...
@@ -168,6 +168,7 @@ def test_wcfs():
Z
=
_
()
Z
.
tidv
=
[]
def
commit
():
print
'commit'
last
.
_p_changed
=
1
transaction
.
commit
()
tid
=
last
.
_p_serial
...
...
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