Gordon Sim wrote:
I am seeing an automated build hang on the unit tests. It doesn't happen every time or on every machine (running on RHEL5). I _believe_ it was first introduced by the changes to SocketProxy in r758852[1] (can't reproduce the hang before that revision).

I can only reproduce the hang when running under valgrind. From adding in some debug logging it appears to be due to the proxy connection failing to be notified of any connection attempt and therefore keeps waiting to accept.

I.e. the SocketProxy thread spins in the loop starting SocketProxy.cpp:108. The main thread is meanwhile waiting for the connection to open in BrokerFixture.cpp:98.

A little more information on this. It appears that introducing a short sleep before opening the connection in ProxyConnection (i.e. BrokerFixture.cpp:98) I can reproduce the hang quite easily.

I.e. it seems there is some sort of race between the SocketProxy Thread and the main thread that is connecting. Specifically it seems that when the SocketProxy thread gets to the select() on the listener socket (SocketProxy.cpp:111) before the client opens the connection, then SocketProxy thread never leaves the loop waiting for a connection attempt to accept.

Can anyone shed any light on why that might be the case?


[1] http://svn.apache.org/viewvc?view=rev&revision=758852


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to