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
9233294f
Commit
9233294f
authored
Jun 30, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3af1ed43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
wcfs/wcfs.go
wcfs/wcfs.go
+12
-12
No files found.
wcfs/wcfs.go
View file @
9233294f
...
...
@@ -692,17 +692,11 @@ func traceZWatch(format string, argv ...interface{}) {
// 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?
func
(
root
*
Root
)
zwatcher
(
ctx
context
.
Context
,
zwatchq
chan
zodb
.
Event
)
(
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"zwatch %s"
,
root
.
zstor
.
URL
())
// XXX error -> always EIO for data operations
traceZWatch
(
">>>"
)
zwatchq
:=
make
(
chan
zodb
.
Event
)
at0
:=
root
.
zstor
.
AddWatch
(
zwatchq
)
// XXX -> to main thread to avoid race
defer
root
.
zstor
.
DelWatch
(
zwatchq
)
_
=
at0
// XXX XXX
var
zevent
zodb
.
Event
var
ok
bool
...
...
@@ -2176,7 +2170,7 @@ func main() {
stdlog
.
SetFlags
(
stdlog
.
Lmicroseconds
)
}
// open zodb storage/db/connection
// open zodb storage/
watch/
db/connection
ctx
:=
context
.
Background
()
// XXX + timeout?
zstor
,
err
:=
zodb
.
Open
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
,
...
...
@@ -2186,9 +2180,15 @@ func main() {
}
defer
zstor
.
Close
()
zwatchq
:=
make
(
chan
zodb
.
Event
)
at0
:=
zstor
.
AddWatch
(
zwatchq
)
defer
zstor
.
DelWatch
(
zwatchq
)
zdb
:=
zodb
.
NewDB
(
zstor
)
defer
zdb
.
Close
()
// XXX err
zhead
,
err
:=
zopen
(
ctx
,
zdb
,
&
zodb
.
ConnOptions
{
At
:
at0
,
// we need zhead.cache to be maintained across several transactions.
// see "3) for head/bigfile/* the following invariant is maintained ..."
NoPool
:
true
,
...
...
@@ -2299,8 +2299,8 @@ func main() {
// XXX place = ok?
// XXX ctx = ok?
// XXX wait for zwatcher shutdown
.
go
root
.
zwatcher
(
ctx
)
// XXX wait for zwatcher shutdown
+ log from it error
go
root
.
zwatcher
(
ctx
,
zwatchq
)
// TODO handle autoexit
// (exit when kernel forgets all our inodes - wcfs.py keeps .wcfs/zurl
...
...
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