activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Langlois <>
Subject OpenWireConnector in 3.0?
Date Thu, 10 Dec 2009 21:25:29 GMT

I just found brittle code in version 2.2.6 and I do not know if this version is still maintained
or if this code is still present in 3.0. Here is the problem and tell me if it is still relevant:

In OpenWireConnector::createSession()

If an exception is thrown from syncRequest(),

The destructor of OpenWireSessionInfo will be called while the stack is unrolled. In that

BaseConnectorResource::close() throw ( cms::CMSException ) is called.

which will call

void OpenWireConnector::disposeOf(
    commands::DataStructure* objectId ) throw ( ConnectorException )

which will call oneway().

The thing is that it is very unlikely that oneway() will succeed if syncRequest() fail and
this will abort the program since this is what happens when an exception slips out of a destructor
while the stack is unrolling because of an exception.

I would propose to not let exception slip out of the destructor:

        virtual ~OpenWireSessionInfo() {
            catch(...) { /*absorb*/ }
            delete sessionInfo;

But I cannot find this code in 3.0. Has it been removed?

Olivier Langlois
C++ Technical Lead


t. 1 866 448 4037 ext. 675
t. 1 514 448 4037 ext. 675
f. 1 514 807 1861
StreamTheWorld launches its new BlackBerry application. Learn more

View raw message