Commit 102b571e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e177e16e
...@@ -572,10 +572,8 @@ type BigFile struct { ...@@ -572,10 +572,8 @@ type BigFile struct {
// //
// both watches in already "established" state (i.e. initial watch // both watches in already "established" state (i.e. initial watch
// request was completed and answered with "ok"), and watches in // request was completed and answered with "ok"), and watches in
// progress of being established. XXX text // progress of being established are kept here.
// watchMu sync.Mutex // XXX use
// XXX locking -> watchMu?
// XXX -> watches ?
watchTab map[*Watch]struct{} watchTab map[*Watch]struct{}
} }
...@@ -1164,8 +1162,8 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro ...@@ -1164,8 +1162,8 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro
} }
// we have the data - it can be used after watchers are updated // we have the data - it can be used after watchers are updated
// XXX should we use ctx here? (see pinWatchers comments) // XXX should we use ctx here? (see readPinWatchers comments)
f.pinWatchers(ctx, blk, treepath, zblk, blkrevMax) f.readPinWatchers(ctx, blk, treepath, zblk, blkrevMax)
// data can be used now // data can be used now
close(loading.ready) close(loading.ready)
...@@ -1322,8 +1320,9 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) { ...@@ -1322,8 +1320,9 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
return nil return nil
} }
*/
// pinWatchers complements readBlk: it sends `pin blk` for watchers of the file // readPinWatchers complements readBlk: it sends `pin blk` for watchers of the file
// after a block was loaded from ZODB and before block data is returned to kernel. // after a block was loaded from ZODB and before block data is returned to kernel.
// //
// See "7.2) for all registered client@at watchers ..." // See "7.2) for all registered client@at watchers ..."
...@@ -1333,7 +1332,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) { ...@@ -1333,7 +1332,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?
func (f *BigFile) pinWatchers(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 {
return return
......
...@@ -207,7 +207,7 @@ class tDB: ...@@ -207,7 +207,7 @@ class tDB:
# still wait for request completion even after fatal signal ) # still wait for request completion even after fatal signal )
t._closed = chan() t._closed = chan()
t._wcfuseabort = open("/sys/fs/fuse/connections/%d/abort" % os.stat(testmntpt).st_dev, "w") t._wcfuseabort = open("/sys/fs/fuse/connections/%d/abort" % os.stat(testmntpt).st_dev, "w")
go(t._abort_ontimeout, 7*time.second) # NOTE must be >> with_timeout go(t._abort_ontimeout, 10*time.second) # NOTE must be >> with_timeout
# ZBigFile(s) scheduled for commit # ZBigFile(s) scheduled for commit
t._changed = {} # ZBigFile -> {} blk -> data t._changed = {} # ZBigFile -> {} blk -> data
......
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