[jboss-jira] [JBoss JIRA] (JBNAME-53) InitialContext#lookup does not timeout on cached context
Stian Thorgersen (JIRA)
jira-events at lists.jboss.org
Fri Mar 16 05:14:51 EDT 2012
[ https://issues.jboss.org/browse/JBNAME-53?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stian Thorgersen closed JBNAME-53.
----------------------------------
Resolution: Out of Date
> InitialContext#lookup does not timeout on cached context
> --------------------------------------------------------
>
> Key: JBNAME-53
> URL: https://issues.jboss.org/browse/JBNAME-53
> Project: JBoss Naming
> Issue Type: Bug
> Reporter: Stian Thorgersen
>
> I've got an issue where InitialContext#lookup will hang forever doing a lookup if there is a problem with the network. I appreciate this is the default settings of the TCP sockets to wait forever, so I've tried to configure the timeout using 'jnp.timeout' and 'jnp.sotimeout'. If the network is disconnected prior to the first attempt to do a lookup it times out as expected (I assume this is 'jnp.timeout' which configures the timeout to create the connection). However, if the network is disconnected after one ore more successful lookups have been performed it waits forever. I assume this is there 'jnp.sotimeout' should have kicked in, but doesn't seem to.
> {code}
> Hashtable<String, String> env = new Hashtable<String, String>();
> env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
> env.put("java.naming.provider.url", "jnp://10.9.1.11:1099");
> env.put("java.naming.factory.url.pkgs", "org.jboss.naming");
> env.put("jnp.socketFactor", "org.jnp.interfaces.TimedSocketFactory");
> env.put("jnp.timeout", "1000");
> env.put("jnp.sotimeout", "1000");
>
> InitialContext ctx = new InitialContext(env);
>
> ctx.lookup("something");
>
> // disconnect network here
>
> ctx.lookup("something");
> {code}
> In the above example if I disconnect the network before the first lookup it times out as expected, but if I disconnect the network between the first lookup and the second lookup it waits forever. I've tried to wrap it in a thread, that is then interrupted after a timeout, but that doesn't work.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list