@@ -2239,10 +2239,19 @@ class Transaction(object):
def _process_reply(self, msg):
if msg.type == ovs.jsonrpc.Message.T_ERROR:
- self._status = Transaction.ERROR
+ if msg.error == "canceled":
+ # ovsdb-server uses this error message to indicate that the
+ # transaction was canceled because the database in question was
+ # removed, converted, etc.
+ self._status = Transaction.TRY_AGAIN
+ else:
+ self._status = Transaction.ERROR
+ self.__set_error_json(msg.error)
elif not isinstance(msg.result, (list, tuple)):
# XXX rate-limit
vlog.warn('reply to "transact" is not JSON array')
+ self._status = Transaction.ERROR
+ self.__set_error_json(msg.result)
else:
hard_errors = False
soft_errors = False
Port of C commit 1b1d2e6daa56 ("ovsdb: Introduce experimental support for clustered databases"). A top-level JSON-RPC error reply of "canceled" means ovsdb-server aborted the transaction because the database in question was removed, converted, etc.; treat it as TRY_AGAIN rather than a hard error. For any other top-level error, and for a reply that is not a JSON array, record the offending JSON on the transaction so the client can inspect it. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Terry Wilson <twilson@redhat.com> --- python/ovs/db/idl.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)