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
f21771d3
Commit
f21771d3
authored
Jul 04, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a7e3e8f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
wcfs/wcfs.go
wcfs/wcfs.go
+6
-6
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+1
-1
No files found.
wcfs/wcfs.go
View file @
f21771d3
...
@@ -622,7 +622,7 @@ type Watch struct {
...
@@ -622,7 +622,7 @@ type Watch struct {
link
*
WatchLink
// link to client
link
*
WatchLink
// link to client
file
*
BigFile
// XXX needed?
file
*
BigFile
// XXX needed?
mu
sync
.
Mutex
// XXX
ok ?
mu
sync
.
Mutex
// XXX
split -> atMu(RW) + pinnedMu
at
zodb
.
Tid
// requested to be watched @at
at
zodb
.
Tid
// requested to be watched @at
pinned
map
[
int64
]
*
blkPinState
// {} blk -> {... rev} blocks that are already pinned to be ≤ at
pinned
map
[
int64
]
*
blkPinState
// {} blk -> {... rev} blocks that are already pinned to be ≤ at
}
}
...
@@ -1298,7 +1298,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
...
@@ -1298,7 +1298,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
w
.
mu
.
Lock
()
w
.
mu
.
Lock
()
// XXX ignore vvv ? (w.at could be ↑ after precheck in read (XXX or setup
Blk
)
// XXX ignore vvv ? (w.at could be ↑ after precheck in read (XXX or setup
Watch
)
if
wat
:=
w
.
at
;
!
(
rev
==
zodb
.
TidMax
||
rev
<=
wat
)
{
if
wat
:=
w
.
at
;
!
(
rev
==
zodb
.
TidMax
||
rev
<=
wat
)
{
w
.
mu
.
Unlock
()
w
.
mu
.
Unlock
()
panicf
(
"f<%s>: wlink%d: pin #%d @%s: watch.at (%s) < rev"
,
panicf
(
"f<%s>: wlink%d: pin #%d @%s: watch.at (%s) < rev"
,
...
@@ -1383,7 +1383,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
...
@@ -1383,7 +1383,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
//
//
// XXX do we really need to use/propagate caller context here? ideally update
// XXX do we really need to use/propagate caller context here? ideally update
// watchers should be synchronous, and in practice we just use 30s timeout.
// watchers should be synchronous, and in practice we just use 30s timeout.
// Should a READ interrupt cause watch update failure?
// Should a READ interrupt cause watch update failure?
-> probably no
func
(
f
*
BigFile
)
readPinWatchers
(
ctx
context
.
Context
,
blk
int64
,
treepath
[]
btree
.
LONode
,
zblk
zBlk
,
blkrevMax
zodb
.
Tid
)
{
func
(
f
*
BigFile
)
readPinWatchers
(
ctx
context
.
Context
,
blk
int64
,
treepath
[]
btree
.
LONode
,
zblk
zBlk
,
blkrevMax
zodb
.
Tid
)
{
// only head/ is being watched for
// only head/ is being watched for
if
f
.
head
.
rev
!=
0
{
if
f
.
head
.
rev
!=
0
{
...
@@ -1418,7 +1418,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
...
@@ -1418,7 +1418,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
// XXX locking (w)
// XXX locking (w)
// the block is already covered by @w.at database view
// the block is already covered by @w.at database view
if
blkrev
<=
w
.
at
{
if
blkrev
<=
w
.
at
{
// XXX locking
continue
continue
}
}
...
@@ -1429,7 +1429,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
...
@@ -1429,7 +1429,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
blkrevRough
=
false
blkrevRough
=
false
// XXX w.at could be only ↑ ? if not - locking is more complex
// XXX w.at could be only ↑ ? if not - locking is more complex
if
blkrev
<=
w
.
at
{
if
blkrev
<=
w
.
at
{
// XXX locking
continue
continue
}
}
}
}
...
@@ -1440,7 +1440,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
...
@@ -1440,7 +1440,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
// and most of them would be on different w.at - cache of the file will
// and most of them would be on different w.at - cache of the file will
// be lost. Via pinning to particular block revision, we make sure the
// be lost. Via pinning to particular block revision, we make sure the
// revision to pin is the same on all clients, and so file cache is shared.
// revision to pin is the same on all clients, and so file cache is shared.
pinrev
,
_
:=
w
.
file
.
LastBlkRev
(
ctx
,
blk
,
w
.
at
)
// XXX move into go?
pinrev
,
_
:=
w
.
file
.
LastBlkRev
(
ctx
,
blk
,
w
.
at
)
// XXX
locking (w),
move into go?
wg
.
Go
(
func
()
error
{
wg
.
Go
(
func
()
error
{
// XXX close watcher on any error
// XXX close watcher on any error
...
...
wcfs/wcfs_test.py
View file @
f21771d3
...
@@ -60,7 +60,7 @@ def setup_module():
...
@@ -60,7 +60,7 @@ def setup_module():
install_sigbus_trap
()
install_sigbus_trap
()
# if wcfs.go is built with race detector and detects a race - make it fail
# if wcfs.go is built with race detector and detects a race - make it fail
# current test loudly on the first wcfs.go race
# current test loudly on the first wcfs.go race
.
gorace
=
os
.
environ
.
get
(
"GORACE"
,
""
)
gorace
=
os
.
environ
.
get
(
"GORACE"
,
""
)
if
gorace
!=
""
:
if
gorace
!=
""
:
gorace
+=
" "
gorace
+=
" "
...
...
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