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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
3acc5bbf
Commit
3acc5bbf
authored
Jan 13, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
30a8ea09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
wcfs/__init__.py
wcfs/__init__.py
+1
-1
wcfs/wcfs.go
wcfs/wcfs.go
+14
-6
No files found.
wcfs/__init__.py
View file @
3acc5bbf
...
...
@@ -120,7 +120,7 @@ def join(zurl, autostart=_default_autostart()):
raise
RuntimeError
(
"wcfs: join %s: server not started"
%
zurl
)
# start wcfs with telling it to automatically exit when there is no client activity.
return
_start
(
zurl
,
"-autoexit"
,
'-d'
,
'-alsologtostderr'
)
return
_start
(
zurl
,
"-autoexit"
,
'-d'
,
'-alsologtostderr'
,
'-v=1'
)
# _start starts wcfs server for ZODB @ zurl.
...
...
wcfs/wcfs.go
View file @
3acc5bbf
...
...
@@ -527,13 +527,21 @@ func (cc *zodbCacheControl) WantEvict(obj zodb.IPersistent) bool {
return
false
}
func
traceWatch
(
format
string
,
argv
...
interface
{})
{
if
!
log
.
V
(
1
)
{
// XXX -> 2?
return
}
log
.
Infof
(
"zwatcher: "
+
format
,
argv
...
)
}
// zwatcher watches for ZODB changes.
// see "4) when we receive an invalidation message from ZODB ..."
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 ...
"
)
traceWatch
(
">>>
"
)
zwatchq
:=
make
(
chan
zodb
.
CommitEvent
)
root
.
zstor
.
AddWatch
(
zwatchq
)
...
...
@@ -543,18 +551,19 @@ func (root *Root) zwatcher(ctx context.Context) (err error) {
var
ok
bool
for
{
log
.
Info
(
"ZWatcher: select ..."
)
traceWatch
(
"select ..."
)
select
{
case
<-
ctx
.
Done
()
:
log
.
Info
(
"cancel"
)
traceWatch
(
"cancel"
)
return
ctx
.
Err
()
case
zevent
,
ok
=
<-
zwatchq
:
log
.
Info
(
"event"
,
zevent
,
ok
)
if
!
ok
{
traceWatch
(
"zwatchq closed"
)
return
nil
// closed XXX ok?
}
traceWatch
(
"zevent: %s"
,
zevent
)
}
root
.
zhandle1
(
zevent
)
...
...
@@ -563,7 +572,6 @@ 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
()
...
...
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