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
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 {
link
*
WatchLink
// link to client
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
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) {
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
)
{
w
.
mu
.
Unlock
()
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) {
//
// 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.
// 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
)
{
// only head/ is being watched for
if
f
.
head
.
rev
!=
0
{
...
...
@@ -1418,7 +1418,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
// XXX locking (w)
// the block is already covered by @w.at database view
if
blkrev
<=
w
.
at
{
if
blkrev
<=
w
.
at
{
// XXX locking
continue
}
...
...
@@ -1429,7 +1429,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
blkrevRough
=
false
// XXX w.at could be only ↑ ? if not - locking is more complex
if
blkrev
<=
w
.
at
{
if
blkrev
<=
w
.
at
{
// XXX locking
continue
}
}
...
...
@@ -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
// 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.
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
{
// XXX close watcher on any error
...
...
wcfs/wcfs_test.py
View file @
f21771d3
...
...
@@ -60,7 +60,7 @@ def setup_module():
install_sigbus_trap
()
# 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"
,
""
)
if
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