-
1. Re: JMS Bridge stops retrying even with unlimited retry configured
timfox Jun 13, 2010 4:52 AM (in response to gaohoward)[Moved from user forum]
-
2. Re: JMS Bridge stops retrying even with unlimited retry configured
timfox Jun 13, 2010 4:54 AM (in response to timfox)Also see
Also see https://jira.jboss.org/browse/HORNETQ-393
and
https://community.jboss.org/thread/152227?tstart=0 -
3. Re: JMS Bridge stops retrying even with unlimited retry configured
timfox Jun 13, 2010 4:55 AM (in response to timfox)Howard, as a matter of interest, what are the params in the JBoss JNDI impl that handle timeouts? And is there are a reference to some documentation on this?
-
4. Re: JMS Bridge stops retrying even with unlimited retry configured
timfox Jun 13, 2010 4:59 AM (in response to timfox)In HornetQ, the only we do pinging to detect the case where the network has disappeared, so really the only place we have to worry about is the JNDI lookups which isn't under our control, since it's not our code.
Any well written JNDI impl should be able to have timeouts configured.
-
5. Re: JMS Bridge stops retrying even with unlimited retry configured
gaohoward Jun 13, 2010 5:31 AM (in response to timfox)looks like
jnp.sotimeout, I haven't tried it though.
I found this:
http://www.mail-archive.com/jboss-user@lists.sourceforge.net/msg28944.html//www.mail-archive.com/jboss-user@lists.sourceforge.net/msg28944.html
-
6. Re: JMS Bridge stops retrying even with unlimited retry configured
timfox Jun 13, 2010 5:38 AM (in response to gaohoward)Thanks Howard,
I think what might be a good idea here would be test this out, by creating a simple test client which does a JNDI lookup in a loop.
Have two machines, client and server. Then cause the network to disappear - this could be simulated by pulling out the ethernet cable or bringing down the network interface on the server. e.g. /sbin/ifconfig eth0 down
Doing this should simulate a "hang" on a JNDI look. Once this is replicated, could try setting timeouts to see if it solves the problem.
-
7. Re: JMS Bridge stops retrying even with unlimited retry configured
timfox Jun 13, 2010 5:40 AM (in response to timfox)BTW, I found more info on the timeout config here:
Apparently the default is to block for ever.
So maybe the solution is pretty simple - just set the correct timeouts?
We should verify this though with an experiment
jnp.timeout: The connection timeout in milliseconds. The default value is 0 which means the connection will block until the VM TCP/IP layer times out.
jnp.sotimeout: The connected socket read timeout in milliseconds. The default value is 0 which means reads will block. This is the value passed to the
Socket.setSoTimeout
on the newly connected socket.
-
8. Re: JMS Bridge stops retrying even with unlimited retry configured
gaohoward Jun 13, 2010 6:30 AM (in response to timfox)Yes it worth a try. I'll do it.
Thanks
-
9. Re: JMS Bridge stops retrying even with unlimited retry configured
ataylor Jun 22, 2010 2:38 AM (in response to gaohoward)Yong Hao Gao wrote:
Yes it worth a try. I'll do it.
Thanks
Howard, did you get anywhere with this, if so did you verify the timeout worked, if not i will try it myself.
Andy
-
10. Re: JMS Bridge stops retrying even with unlimited retry configured
ataylor Jun 22, 2010 9:55 AM (in response to ataylor)Ok, so these settings dont work in either linux or windows, i spoke to Carlo and he says that this working is dependant more on the TCP settings. So I'm going to wrap the jndi lookups in a runnable and use a Future to time them out.
-
11. Re: JMS Bridge stops retrying even with unlimited retry configured
timfox Jun 22, 2010 11:22 AM (in response to ataylor)These are just socket timeouts so, yes, they will work.
There should be no need to wrap things up in our own timeours, and anyway, this technique is fraught with difficulties.
Can you explain what you did to make you come to the conclusion Java socket timeouts don't work?
-
12. Re: JMS Bridge stops retrying even with unlimited retry configured
ataylor Jun 22, 2010 11:33 AM (in response to timfox)I wrote a simple loop that looked up an object via jndi. I made sure the initial context had the jnp.timeout and jnp.sotimeout set ran the loop and un plugged the network cable. I did this on linux and windows and in both cases the lookup just hung.
I spoke to carlo and he said that he though that these settings would only work if the underlying tcp config was configured appropiately.
-
13. Re: JMS Bridge stops retrying even with unlimited retry configured
timfox Jun 22, 2010 11:46 AM (in response to ataylor)Andy Taylor wrote:
I wrote a simple loop that looked up an object via jndi. I made sure the initial context had the jnp.timeout and jnp.sotimeout set ran the loop and un plugged the network cable. I did this on linux and windows and in both cases the lookup just hung.
I spoke to carlo and he said that he though that these settings would only work if the underlying tcp config was configured appropiately.
That's exactly what it should be doing - those settings *are* TCP config. The JNDI impl should be setting them on the socket when it creates it.
You could check the JNDI client code to make sure that's happening correctly.
-
14. Re: JMS Bridge stops retrying even with unlimited retry configured
ataylor Jun 22, 2010 11:49 AM (in response to timfox)I'll download the jndi src and also try a different version.