Commit 07dbbe39 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6d940c61
...@@ -1389,7 +1389,7 @@ func traceIso(format string, argv ...interface{}) { ...@@ -1389,7 +1389,7 @@ func traceIso(format string, argv ...interface{}) {
// //
// must be called with atMu rlocked. // must be called with atMu rlocked.
// //
// XXX error - when? or close watch on any error? // TODO close watch on any error
func (w *Watch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) { func (w *Watch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
defer xerr.Contextf(&err, "wlink%d: f<%s>", w.link.id, w.file.zfile.POid()) defer xerr.Contextf(&err, "wlink%d: f<%s>", w.link.id, w.file.zfile.POid())
return w._pin(ctx, blk, rev) return w._pin(ctx, blk, rev)
...@@ -1559,7 +1559,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, blkrevMax zodb ...@@ -1559,7 +1559,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, blkrevMax zodb
return err return err
} }
//fmt.Printf("S: read #%d: watch @%s: pin -> @%s\n", blk, w.at, pinrev) //fmt.Printf("S: read #%d: watch @%s: pin -> @%s\n", blk, w.at, pinrev)
// XXX close watcher on any error // TODO close watcher on any error
return w.pin(ctx, blk, pinrev) return w.pin(ctx, blk, pinrev)
}) })
} }
...@@ -1687,7 +1687,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T ...@@ -1687,7 +1687,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
f.watchMu.Unlock() f.watchMu.Unlock()
wlink.byfileMu.Unlock() wlink.byfileMu.Unlock()
// XXX defer -> unregister watch if error? // TODO defer -> unregister watch if error
// pin all tracked file blocks that were changed in (at, head] range. // pin all tracked file blocks that were changed in (at, head] range.
toPin := map[int64]zodb.Tid{} // blk -> @rev toPin := map[int64]zodb.Tid{} // blk -> @rev
...@@ -1738,7 +1738,6 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T ...@@ -1738,7 +1738,6 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// if a block was previously pinned, but ∉ δ(at, head] -> unpin it to head. // if a block was previously pinned, but ∉ δ(at, head] -> unpin it to head.
for blk, pinPrev := range w.pinned { for blk, pinPrev := range w.pinned {
// only 1 setupWatch can be run simultaneously for one file // only 1 setupWatch can be run simultaneously for one file
// XXX assert pinPrev.rev != zodb.TidMax
pinNew, pinning := toPin[blk] pinNew, pinning := toPin[blk]
if !pinning { if !pinning {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment