activemq-dev mailing list archives

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

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
destructor,

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() {
            try
            {
                this->close();
            }
            catch(...) { /*absorb*/ }
            delete sessionInfo;
        }

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

Thanks,
Olivier Langlois
C++ Technical Lead

STREAMTHEWORLD

t. 1 866 448 4037 ext. 675
t. 1 514 448 4037 ext. 675
f. 1 514 807 1861

olivier.langlois@streamtheworld.com
streamtheworld.com
 
StreamTheWorld launches its new BlackBerry application. Learn more


Mime
View raw message