2 Replies Latest reply on Feb 13, 2012 9:00 PM by yannywang

    HornetQ 2.2.8 createSession blocked after server was restarted.

    yannywang

      We start some consumer to the HornetQ 2.2.8 server, it works fine. we then ./stop.sh the server and then start the server after a while.

       

      our code has a scheduled task to heart bet the consumer and recreate the consumer when it's not available. but the create session is always blocked after the server is restarted:

      here is the jstack for the re-create thread:

       

      java.lang.Thread.State: BLOCKED (on object monitor)

              at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:741)

              - waiting to lock <0x00000000e2569b48> (a java.lang.Object)

              - locked <0x00000000e2569b38> (a java.lang.Object)

              at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:324)

       

      is this a known issue?

        • 1. Re: HornetQ 2.2.8 createSession blocked after server was restarted.
          ataylor

          can you post your configuration, this i strying to re establish the connection but for some reason it cant, maybe some of your config is wrong

          • 2. Re: HornetQ 2.2.8 createSession blocked after server was restarted.
            yannywang

            Hi Andy,

            thanks for looking into this.

             

            Here is my configuration file:

             

            <configuration xmlns="urn:hornetq"
                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                           xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

                <paging-directory>${data.dir:../data}/paging</paging-directory>

                <bindings-directory>${data.dir:../data}/bindings</bindings-directory>

                <journal-directory>${data.dir:../data}/journal</journal-directory>

                <journal-min-files>100</journal-min-files>

                <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory>
               
                <security-enabled>false</security-enabled>
            <journal-sync-non-transactional>false</journal-sync-non-transactional>

                <connectors>
                    <!--connector name="netty">
                       <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                       <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>
                       <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
                    </connector-->

                    <!--connector name="netty-throughput">
                        <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                        <param key="host" value="${hornetq.remoting.netty.host:localhost}"/>
                        <param key="port" value="${hornetq.remoting.netty.batch.port:5455}"/>
                        <param key="batch-delay" value="50"/>
                        <param key="direct-deliver" value="true"/>
                        <param key="use-nio" value="false"/>
                        <param key="tcp-no-delay" value="true"/>
                        <param key="tcp-send-buffer-size" value="1048576"/>
                        <param key="tcp-receive-buffer-size" value="1048576"/>
                    </connector-->
                </connectors>

                <acceptors>
                    <!--acceptor name="netty">
                       <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                       <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>
                       <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
                    </acceptor-->

                    <acceptor name="netty-throughput">
                        <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                        <param key="host" value="${hornetq.remoting.netty.host:localhost}"/>
                        <param key="port" value="${hornetq.remoting.netty.batch.port:5455}"/>
                        <!--param key="batch-delay" value="50"/>
                        <param key="direct-deliver" value="true"/>
                        <param key="use-nio" value="false"/>
                        <param key="tcp-no-delay" value="true"/>
                        <param key="tcp-send-buffer-size" value="1048576"/>
                        <param key="tcp-receive-buffer-size" value="1048576"/-->
                    </acceptor>
                </acceptors>

                <!--
                <security-settings>
                   <security-setting match="#">
                      <permission type="createNonDurableQueue" roles="guest"/>
                      <permission type="deleteNonDurableQueue" roles="guest"/>
                      <permission type="consume" roles="guest"/>
                      <permission type="send" roles="guest"/>
                   </security-setting>
                </security-settings>
                -->

                <queues>
                    <queue name="DLQ">
                        <address>DLQ</address>
                        <durable>true</durable>
                    </queue>
                    <queue name="ExpiryQueue">
                        <address>ExpiryQueue</address>
                        <durable>true</durable>
                    </queue>
                </queues>

                <address-settings>
                    <!--default for catch all-->
                    <address-setting match="#">
                        <dead-letter-address>DLQ</dead-letter-address>
                        <expiry-address>ExpiryQueue</expiry-address>
                        <max-delivery-attempts>7</max-delivery-attempts>
                        <redelivery-delay>1000</redelivery-delay>
                        <max-size-bytes>10485761</max-size-bytes>
                        <page-size-bytes>10485760</page-size-bytes>
                        <message-counter-history-day-limit>10</message-counter-history-day-limit>
                        <address-full-policy>PAGE</address-full-policy>
                    </address-setting>
                </address-settings>

            </configuration>

             

            the createSession block seems to be released after a long period, like 10 minutes. any clue?