activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier Langlois (JIRA)" <j...@apache.org>
Subject [jira] Created: (AMQCPP-168) Create a connection can block for up to 4 mins under Linux when TCP socket connect() times out
Date Thu, 14 Feb 2008 20:21:35 GMT
Create a connection can block for up to 4 mins under Linux when TCP socket connect() times
out
----------------------------------------------------------------------------------------------

                 Key: AMQCPP-168
                 URL: https://issues.apache.org/activemq/browse/AMQCPP-168
             Project: ActiveMQ C++ Client
          Issue Type: Improvement
          Components: CMS Impl
    Affects Versions: 2.1.3
         Environment: CentOS 4
            Reporter: Olivier Langlois
            Assignee: Nathan Mittler
             Fix For: 2.2


With the following code:

	{
		// Create a ConnectionFactory
		std::auto_ptr<cms::ConnectionFactory> pConnectionFactory(
			cms::ConnectionFactory::createCMSConnectionFactory( uri ) );
		m_pConnection.reset(pConnectionFactory->createConnection());
		m_pConnection->start();
	}

The call to createConnection() will block for up to 4 mins if the URI is a TCP address pointing
to an unreachable host.

In my application, the time out interval is way too long. I would like to have it set to around
5 sec to 10 seconds.

I could take care of the fix if you want as all that would be needed is make the socket non
blocking only for the connect() call and manage the time out with a select(). The only indication
I would need is how you ActiveMQ cms architects/designers would like the timeout specified
to the API.

Using a new property (ie: "connect-timeout")
hardcoding a small timeout value in TcpSocket
etc...



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message