Bug 1135613 - New exception TransactionUnknown in C++ and python APIs.
Summary: New exception TransactionUnknown in C++ and python APIs.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: Messaging_Programming_Reference
Version: 3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: mmurray
QA Contact: Eric Sammons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-29 19:20 UTC by Alan Conway
Modified: 2021-03-03 23:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-03 23:13:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Alan Conway 2014-08-29 19:20:01 UTC
Description of problem:

A new exception TransactionAborted has been added to the python and C++ APIs. It is a subclass of TransactionError and a sibling of TransactionAborted:

 class TransactionError(SessionError):
 """Base class for transactional errors"""
 
 class TransactionAborted(TransactionError):
  """The transaction was automatically rolled back.  This could be due to an error
  on the broker, such as a store failure, or a connection failure during the
  transaction"""

class TransactionUnknown(TransactionError):
  """ The outcome of the transaction on the broker (commit or roll-back) is not
  known. This occurs when the connection fails after we sent the commit but
  before we received a response."""

With TX transactions, TransactionAborted means the transaction rolled back and you can safely repeat it. TransactionUnknown means the outcome is not known because of a connection failure at a critical moment. The only way to tell is to examine the broker queues (or use DTX transactions instead, but they are not yet supported with HA) 

Introduced with fix to Bug 1128051 - QPID-5975: HA extra/missing messages when running qpid-txtest2 in a loop with failover.


Additional info:

Comment 1 Jared MORGAN 2014-09-04 01:26:32 UTC
I've done a quick search in the Programming Reference Guide for "TransactionError" and have found two mentions in http://docbuilder.usersys.redhat.com/19948/#C_Messaging_Exceptions_Reference
This reference only seems to be applicable for C++ though, and not Python. There is currently nowhere obvious to me in the guide where the info for Python could go.

For "TransactionAborted" I found one reference in the link above, plus another in http://docbuilder.usersys.redhat.com/19948/#Session_Exceptions

Comment 2 Frantisek Reznicek 2014-09-04 09:05:30 UTC
(In reply to Jared MORGAN from comment #1)
> I've done a quick search in the Programming Reference Guide for
> "TransactionError" and have found two mentions in
> http://docbuilder.usersys.redhat.com/19948/#C_Messaging_Exceptions_Reference
> This reference only seems to be applicable for C++ though, and not Python.
> There is currently nowhere obvious to me in the guide where the info for
> Python could go.
> 
> For "TransactionAborted" I found one reference in the link above, plus
> another in http://docbuilder.usersys.redhat.com/19948/#Session_Exceptions

Thank you for update.

* The key here is to add TransactionUnknown exception, TransactionError and TransactionAborted are in already in
* Two mentions of TransactionError are ok (including places)
  * one as base class from SessionError
  * one as parent of TransactionAborted
* One place for TransactionAborted is also ok
* TransactionUnknown should go just after TransactionAborted with wording suggested above by Alan

* There is currently no python Exception list/reference and would be not wise/doable to create at this moment. I'll open separate defect for that. Which means Inclusion of C++ exception is enough.

Comment 3 Frantisek Reznicek 2014-09-04 09:17:03 UTC
Need of python exception reference is now tracked separately as bug 1138199.

Comment 4 Jared MORGAN 2014-09-08 01:08:38 UTC
(In reply to Frantisek Reznicek from comment #2)
> (In reply to Jared MORGAN from comment #1)
> > I've done a quick search in the Programming Reference Guide for
> > "TransactionError" and have found two mentions in
> > http://docbuilder.usersys.redhat.com/19948/#C_Messaging_Exceptions_Reference
> > This reference only seems to be applicable for C++ though, and not Python.
> > There is currently nowhere obvious to me in the guide where the info for
> > Python could go.
> > 
> > For "TransactionAborted" I found one reference in the link above, plus
> > another in http://docbuilder.usersys.redhat.com/19948/#Session_Exceptions
> 
> Thank you for update.
> 
> * The key here is to add TransactionUnknown exception, TransactionError and
> TransactionAborted are in already in
> * Two mentions of TransactionError are ok (including places)
>   * one as base class from SessionError
>   * one as parent of TransactionAborted
> * One place for TransactionAborted is also ok
> * TransactionUnknown should go just after TransactionAborted with wording
> suggested above by Alan
> 
> * There is currently no python Exception list/reference and would be not
> wise/doable to create at this moment. I'll open separate defect for that.
> Which means Inclusion of C++ exception is enough.

Thanks for the guidance on this Frantisek.

http://docbuilder.usersys.redhat.com/19948/#C_Messaging_Exceptions_Reference shows the TransactionUnknown exception declared as you specified. Only minor changes to wording provided by Alan.

Comment 5 Frantisek Reznicek 2014-09-08 07:43:36 UTC
Thank you for the change, the content is ok.

-> VERIFIED


Note You need to log in before you can comment on or make changes to this bug.