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
//
// txnvOk is what data to expect to be in the database.
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
// data base entries
before := map[zodb.Oid]objState{}
......@@ -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.
func DrvTestWatch(t *testing.T, zurl string, zdrvOpen zodb.DriverOpener) {
t.Helper()
X := FatalIf(t)
NeedPy(t, "zodbtools")
......
......@@ -90,6 +90,7 @@ func pktEncodeM(m msg) *pktBuf {
// it is interface{} - use shamaton/msgpack since msgp does not handle
// arbitrary interfaces well.
// XXX shamaton/msgpack encodes tuple(nil) as nil, not empty tuple
// XXX move to zLink.Call?
arg := m.arg
tup, ok := arg.(tuple)
if ok && tup == nil {
......@@ -322,12 +323,18 @@ func (e encoding) asTuple(xt interface{}) (tuple, bool) {
panic("bug")
case 'Z':
// pickle: tuples are represented by picklet.Tuple
t, ok := xt.(pickle.Tuple)
return tuple(t), ok
// pickle: tuples are represented by pickle.Tuple; lists as []interface{}
switch t := xt.(type) {
case pickle.Tuple:
return tuple(t), true
case []interface{}:
return tuple(t), true
default:
return tuple(nil), false
}
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{})
return tuple(t), ok
}
......
......@@ -114,8 +114,6 @@ func (z *zeo) Iterate(ctx context.Context, tidMin, tidMax zodb.Tid) zodb.ITxnIte
// invalidateTransaction receives invalidations from server
func (z *zeo) invalidateTransaction(arg interface{}) (err error) {
defer xerr.Context(&err, "invalidateTransaction")
enc := z.link.enc
t, ok := enc.asTuple(arg)
if !ok || len(t) != 2 {
......
......@@ -189,7 +189,10 @@ func (zl *zLink) serveRecv1(pkb *pktBuf) error {
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
}
......
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