Uploaded image for project: 'mod_cluster'
  1. mod_cluster
  2. MODCLUSTER-321

mod_cluster doesn't properly use timeouts in initial proxyList connection attempts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • MOD_CLUSTER_1_0_10_GA_CP02
    • None
    • None
    • Workaround Exists
    • Hide

      -Start JBoss with an empty proxyList so the main thread does not attempt connections to potentially unavailable Apache servers
      -After start up is complete, update the proxyList (through jmx-console or twiddle) to add in available Apaches and they will be connected to through other background threads aside from the main thread and no longer be able to delay start up.

      Show
      -Start JBoss with an empty proxyList so the main thread does not attempt connections to potentially unavailable Apache servers -After start up is complete, update the proxyList (through jmx-console or twiddle) to add in available Apaches and they will be connected to through other background threads aside from the main thread and no longer be able to delay start up.
    • Low

    Description

      mod_cluster doesn't properly use timeouts in initial proxyList connection attempts when JBoss is starting. This can delay start up by several minutes at a time as the main thread stalls in the following call:

      "main" prio=10 tid=0x000000004318d800 nid=0x4085 runnable [0x0000000041822000]
      java.lang.Thread.State: RUNNABLE
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

      • locked <0x00000000f093e6a8> (a java.net.SocksSocketImpl)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at java.net.Socket.connect(Socket.java:478)
        at java.net.Socket.<init>(Socket.java:375)
        at java.net.Socket.<init>(Socket.java:218)
        at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:212)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler$Proxy.getConnection(DefaultMCMPHandler.java:1141)
      • locked <0x00000000f08aa980> (a org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler$Proxy)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler$Proxy.getConnectionWriter(DefaultMCMPHandler.java:1166)
      • locked <0x00000000f08aa980> (a org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler$Proxy)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.sendRequest(DefaultMCMPHandler.java:776)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.sendRequest(DefaultMCMPHandler.java:875)
      • locked <0x00000000f08aa980> (a org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler$Proxy)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.status(DefaultMCMPHandler.java:465)
        at org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler.init(DefaultMCMPHandler.java:140)
        at org.jboss.modcluster.CatalinaEventHandler.init(CatalinaEventHandler.java:113)
      • locked <0x00000000ffdbaac0> (a org.jboss.modcluster.CatalinaEventHandler)
        at org.jboss.modcluster.CatalinaEventHandler.init(CatalinaEventHandler.java:56)
        at org.jboss.modcluster.CatalinaEventHandlerAdapter.lifecycleEvent(CatalinaEventHandlerAdapter.java:127)
        at org.jboss.modcluster.AbstractModClusterService.lifecycleEvent(AbstractModClusterService.java:90)
        at org.jboss.web.tomcat.service.deployers.MicrocontainerIntegrationLifecycleListener.lifecycleEvent(MicrocontainerIntegrationLifecycleListener.java:102)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:741)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:575)

      This happens because DefaultMCMPHandler$Proxy.getConnection hands the address/port straight to the socket factory and so Socket.connect is called without any timeout. Instead, DefaultSocketFactory.createSocket should be called without a given ip/port so that the returned Socket can then be bound with a proper timeout through Socket.connect(SocketAddress endpoint, int timeout). mod_cluster 1.2 currently already does this.

      Attachments

        Activity

          People

            rhn-engineering-jclere Jean-Frederic Clere
            rhn-support-aogburn Aaron Ogburn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: