Commit 9e3cb905 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 30a06c97
...@@ -259,8 +259,6 @@ func checkLoad(t *testing.T, zdrv zodb.IStorageDriver, xid zodb.Xid, expect objS ...@@ -259,8 +259,6 @@ func checkLoad(t *testing.T, zdrv zodb.IStorageDriver, xid zodb.Xid, expect objS
// //
// txnvOk is what data to expect to be in the database. // txnvOk is what data to expect to be in the database.
func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn) { func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn) {
t.Helper()
// current knowledge of what was "before" for an oid as we scan over // current knowledge of what was "before" for an oid as we scan over
// data base entries // data base entries
before := map[zodb.Oid]objState{} before := map[zodb.Oid]objState{}
...@@ -302,7 +300,6 @@ func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn) { ...@@ -302,7 +300,6 @@ func DrvTestLoad(t *testing.T, zdrv zodb.IStorageDriver, txnvOk []Txn) {
// DrvTestWatch verifies that storage driver watcher can observe commits done from outside. // DrvTestWatch verifies that storage driver watcher can observe commits done from outside.
func DrvTestWatch(t *testing.T, zurl string, zdrvOpen zodb.DriverOpener) { func DrvTestWatch(t *testing.T, zurl string, zdrvOpen zodb.DriverOpener) {
t.Helper()
X := FatalIf(t) X := FatalIf(t)
NeedPy(t, "zodbtools") NeedPy(t, "zodbtools")
......
...@@ -90,6 +90,7 @@ func pktEncodeM(m msg) *pktBuf { ...@@ -90,6 +90,7 @@ func pktEncodeM(m msg) *pktBuf {
// it is interface{} - use shamaton/msgpack since msgp does not handle // it is interface{} - use shamaton/msgpack since msgp does not handle
// arbitrary interfaces well. // arbitrary interfaces well.
// XXX shamaton/msgpack encodes tuple(nil) as nil, not empty tuple // XXX shamaton/msgpack encodes tuple(nil) as nil, not empty tuple
// XXX move to zLink.Call?
arg := m.arg arg := m.arg
tup, ok := arg.(tuple) tup, ok := arg.(tuple)
if ok && tup == nil { if ok && tup == nil {
...@@ -322,12 +323,18 @@ func (e encoding) asTuple(xt interface{}) (tuple, bool) { ...@@ -322,12 +323,18 @@ func (e encoding) asTuple(xt interface{}) (tuple, bool) {
panic("bug") panic("bug")
case 'Z': case 'Z':
// pickle: tuples are represented by picklet.Tuple // pickle: tuples are represented by pickle.Tuple; lists as []interface{}
t, ok := xt.(pickle.Tuple) switch t := xt.(type) {
return tuple(t), ok case pickle.Tuple:
return tuple(t), true
case []interface{}:
return tuple(t), true
default:
return tuple(nil), false
}
case 'M': case 'M':
// msgpack: tuples are encoded as arrays; decoded as []interface{} // msgpack: tuples/lists are encoded as arrays; decoded as []interface{}
t, ok := xt.([]interface{}) t, ok := xt.([]interface{})
return tuple(t), ok return tuple(t), ok
} }
......
...@@ -114,8 +114,6 @@ func (z *zeo) Iterate(ctx context.Context, tidMin, tidMax zodb.Tid) zodb.ITxnIte ...@@ -114,8 +114,6 @@ func (z *zeo) Iterate(ctx context.Context, tidMin, tidMax zodb.Tid) zodb.ITxnIte
// invalidateTransaction receives invalidations from server // invalidateTransaction receives invalidations from server
func (z *zeo) invalidateTransaction(arg interface{}) (err error) { func (z *zeo) invalidateTransaction(arg interface{}) (err error) {
defer xerr.Context(&err, "invalidateTransaction")
enc := z.link.enc enc := z.link.enc
t, ok := enc.asTuple(arg) t, ok := enc.asTuple(arg)
if !ok || len(t) != 2 { if !ok || len(t) != 2 {
......
...@@ -189,7 +189,10 @@ func (zl *zLink) serveRecv1(pkb *pktBuf) error { ...@@ -189,7 +189,10 @@ func (zl *zLink) serveRecv1(pkb *pktBuf) error {
return fmt.Errorf(".%d: unknown notification %q", m.msgid, m.method) return fmt.Errorf(".%d: unknown notification %q", m.msgid, m.method)
} }
f(m.arg) err := f(m.arg)
if err != nil {
return fmt.Errorf(".%d: %s: %s", m.msgid, m.method, err)
}
return nil return nil
} }
......
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