activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wayne1285 <WayneSIr...@hotmail.com>
Subject Re: Race Condition?
Date Sat, 06 May 2006 21:25:04 GMT

Yes a network race condition. 

 I am no expert in sockets, but some times the response from the broker just
simply gets missed. I added a log statement to the class InactivityMonitor
	public void onCommand(Command command) {
		inReceive.set(true);
		try {
			if (command.isWireFormatInfo()) {
				synchronized (this) {
					remoteWireFormatInfo = (WireFormatInfo) command;
					log.debug("Just received remoteWireFormatInfo");
					try {
						startMonitorThreads();
					} catch (IOException e) {
						onException(e);
					}
				}
			}
			getTransportListener().onCommand(command);
		} finally {
			inReceive.set(false);
			commandReceived.set(true);
		}
	}

But it soemtimes does not execute.  Without the remoteWireFormatInfo, the
request to StartMonitorThreads() does not start the threads because all the
preconditions are not met and nothing happens from that point on.

Here is a complete activity list of what I am seeing.
Broker:  Waiting for a connection
Client: Opens a connection.  Connection opens successfullly
Broker: Gets client connection
Client: Sets up socket reader and writer. 
Client: sends LocalWireFormat
Client: waits (forever) for broker to send WireFormatInfo

I have been experimenting with Ethereal to see what is actually transpirig
across the wire.  I had originallay thought the broker was sending its
wireFormatInfo, but it now appears that what I was seeing was it recieving
the clients wireFormatInfo.  It now looks like the broker does not send its
wireFormatInfo when a connection is made.  I am trying to debug this now.

This only occurs after a period of time.  Usually the first few clients will
connect and create sessions as expected.  I am closing the connections when
a client is finsihed.  Perhaps there is some intermittent bug on the broker
that does not set its state correctly when a connection is closed that
causes it not to send the wireFormatInfo the next time a connection is made.




--
View this message in context: http://www.nabble.com/Race-Condition--t1522683.html#a4264483
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message