eBay / go-ovn

A Go library for OVN Northbound/Southbound DB access using native OVSDB protocol
Apache License 2.0
108 stars 59 forks source link

handle error in operations' result from transact method correctly #96

Closed girishmg closed 4 years ago

girishmg commented 4 years ago

the results of the operations specified in the transact method is not correctly verified. we need to always walk through the operations' results to check for null error to claim a transaction has succeded.

furthermore, per RFC 7047 section 4.1.3, if all of the operations succeed, but the results cannot be committed, then "result" will have one more element than "params", with the additional element being an

. this case was not handled as well. with the fix in place, errors related to "constraint violation", "referential integrity violation", "resources exhausted", and "I/O error" are being caught. Signed-off-by: Girish Moodalbail @hzhou8 @noah8713 @vtolstov PTAL
vtolstov commented 4 years ago

LGTM