Commit 702c62e4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent dc1ad0d9
......@@ -623,24 +623,6 @@ mainloop:
}
}
/*
// XXX doc
func (fs *FileStorage) Watch(ctx context.Context) (_ zodb.Tid, _ []zodb.Oid, err error) {
defer xerr.Contextf(&err, "%s: watch", fs.file.Name())
select {
case <-ctx.Done():
return zodb.InvalidTid, nil, ctx.Err()
case <-fs.down:
return zodb.InvalidTid, nil, os.ErrClosed // FIXME -> proper error
case w := <-fs.watchq:
return w.tid, w.oidv, nil
}
}
*/
// --- open + rebuild index ---
func (fs *FileStorage) shutdown() {
......@@ -652,6 +634,8 @@ func (fs *FileStorage) shutdown() {
func (fs *FileStorage) Close() error {
fs.shutdown()
// XXX wait for watcher?
if fs.errClose != nil {
return &zodb.OpError{URL: fs.URL(), Op: "close", Args: nil, Err: fs.errClose}
}
......
......@@ -354,14 +354,14 @@ func BenchmarkIterate(b *testing.B) {
b.StopTimer()
}
// XXX kill
var tracef = func(format string, argv ...interface{}) {
log.Printf("W " + format, argv...)
}
func init() {
log.SetFlags(log.Lmicroseconds)
}
// // XXX kill
// var tracef = func(format string, argv ...interface{}) {
// log.Printf("W " + format, argv...)
// }
//
// func init() {
// log.SetFlags(log.Lmicroseconds)
// }
......@@ -412,8 +412,8 @@ func TestWatch(t *testing.T) {
}
xcommit := func(at zodb.Tid, objv ...Object) zodb.Tid {
tracef("-> xcommit %s", at)
defer tracef("<- xcommit")
//tracef("-> xcommit %s", at)
//defer tracef("<- xcommit")
t.Helper()
tid, err := zcommit(at, objv...)
if err != nil {
......@@ -483,3 +483,8 @@ func TestWatch(t *testing.T) {
// t.Fatalf("watch after close -> %v; want: cause %v", err, eWant)
//}
}
// TestOpenRecovery verifies how Open handles data file with not-finished voted
// transaction in the end.
func TestOpenRecovery(t *testing.T) {
}
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