Uploaded image for project: 'JBoss Naming'
  1. JBoss Naming
  2. JBNAME-51

Delay in connecting when first of multiple providers is down can cause performance issue

XMLWordPrintable

    • Workaround Exists
    • Hide

      Cache the InitialContext in client code.
      This is only triggered when creating a new InitialContext.

      Show
      Cache the InitialContext in client code. This is only triggered when creating a new InitialContext.

      org.jnp.interfaces.NamingContext.checkRef always loops through the provider list in order,
      trying to connect to the first before checking for a cached connection to a later provider.

      This affects performance because it can cause a delay on every context created, waiting for a timeout on a node that is down.

      For instance, the following takes a very long time when node1 is down.

      ...
      env.put ( Context.PROVIDER_URL, "node1:1100,node2:1100" );
      for ( int i = 0; i < 1000; ++ i )

      { InitialContext ctx = new InitialContext ( env ); ... }

      If checkRef looked for a cached connection to any of the listed providers before trying to connect to an uncached one,
      there would only be a timeout delay on the very first connection attempt.

              rhn-support-dereed Dennis Reed
              rhn-support-dereed Dennis Reed
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: