Commit e8c3499d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 2b18dfc1
...@@ -1535,6 +1535,7 @@ func main() { ...@@ -1535,6 +1535,7 @@ func main() {
defer zstor.Close() defer zstor.Close()
zdb := zodb.NewDB(zstor) zdb := zodb.NewDB(zstor)
defer zdb.Close() // XXX err
zhead, err := zopen(ctx, zdb, &zodb.ConnOptions{ zhead, err := zopen(ctx, zdb, &zodb.ConnOptions{
// we need zhead.cache to be maintained across several transactions. // we need zhead.cache to be maintained across several transactions.
// see "3) for head/bigfile/* the following invariant is maintained ..." // see "3) for head/bigfile/* the following invariant is maintained ..."
...@@ -1543,7 +1544,9 @@ func main() { ...@@ -1543,7 +1544,9 @@ func main() {
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
zhead.Cache().SetControl(&zodbCacheControl{}) // XXX +locking? zhead.Cache().Lock()
zhead.Cache().SetControl(&zodbCacheControl{})
zhead.Cache().Unlock()
// mount root + head/ // mount root + head/
// XXX -> newHead() // XXX -> newHead()
......
...@@ -46,6 +46,9 @@ func TestZBlk(t *testing.T) { ...@@ -46,6 +46,9 @@ func TestZBlk(t *testing.T) {
ctx := context.Background() ctx := context.Background()
stor, err := zodb.OpenStorage(ctx, "testdata/zblk.fs", &zodb.OpenOptions{ReadOnly: true}); X(err) stor, err := zodb.OpenStorage(ctx, "testdata/zblk.fs", &zodb.OpenOptions{ReadOnly: true}); X(err)
db := zodb.NewDB(stor) db := zodb.NewDB(stor)
defer func() {
err := db.Close(); X(err)
}()
txn, ctx := transaction.New(ctx) txn, ctx := transaction.New(ctx)
defer txn.Abort() defer txn.Abort()
......
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