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
150cf9a7
Commit
150cf9a7
authored
Jul 04, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
22769012
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
wcfs/wcfs.go
wcfs/wcfs.go
+4
-4
No files found.
wcfs/wcfs.go
View file @
150cf9a7
...
...
@@ -1250,6 +1250,7 @@ func (f *BigFile) updateWatchers(ctx context.Context, blk int64, treepath []btre
blkrev
,
_
=
f
.
LastBlkRev
(
ctx
,
blk
,
f
.
head
.
zconn
.
At
())
blkrevRough
=
false
// XXX w.at could be only ↑ ? if not - locking is more complex
if
blkrev
<=
w
.
at
{
continue
}
...
...
@@ -1370,6 +1371,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
// XXX locking?
// XXX simultaneous calls?
// XXX ignore vvv ? (w.at could be ↑ after precheck in read (XXX or setupBlk)
if
!
(
rev
==
zodb
.
TidMax
||
rev
<=
w
.
at
)
{
panicf
(
"f<%s>: wlink%d: pin #%d @%s: watch.at (%s) < rev"
,
foid
,
w
.
link
.
id
,
blk
,
rev
,
w
.
at
)
...
...
@@ -1426,6 +1428,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
defer
head
.
zheadMu
.
RUnlock
()
headAt
:=
head
.
zconn
.
At
()
// XXX δFtail locking? (or ForgetPast is called only with zheadMu.W ?)
if
at
!=
zodb
.
InvalidTid
&&
at
<
bfdir
.
δFtail
.
Tail
()
{
return
fmt
.
Errorf
(
"too far away back from head/at (@%s); δt = %s"
,
headAt
,
headAt
.
Time
()
.
Sub
(
at
.
Time
()
.
Time
))
...
...
@@ -1501,6 +1504,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
//
// XXX locking
// XXX register only if watch was created anew, not updated?
w
.
at
=
at
f
.
watchTab
[
w
]
=
struct
{}{}
wlink
.
byfile
[
foid
]
=
w
...
...
@@ -1536,10 +1540,6 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
}
}
// XXX locking
// XXX do at the same time when registering ^^^, so that simultaneous READs see correct w.at
w
.
at
=
at
wg
,
ctx
:=
errgroup
.
WithContext
(
ctx
)
for
blk
,
rev
:=
range
toPin
{
blk
:=
blk
...
...
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