8 Replies Latest reply: May 5, 2004 12:43 PM by Raja RSS

    Interrupted while requesting permit!

    Stephane Nicoll Master

      Our environment is Jboss 3.2.3 on linux redhat9, DB is postgresql 7.3.4 and we use it as JBossMQ persistence manager.

      We have a session bean that call a method with RequiresNew. This method does the following:

      - Read a message in a queue
      - Do some processing with the message (calling an MBean that will write some file to disk).

      Sometimes (but it's reproductible, we got the following stacktrace:

      17:31:52,303 WARN [jboss.tm.TransactionImpl] Transaction TransactionImpl:XidImpl [FormatId=257, GlobalId=biohazard.dev.XXXXX.com//45, BranchQual=] timed out. status=STATUS_ACTIVE
      17:31:52,376 ERROR [adapter.jms.JmsSessionFactoryImpl] could not create session
      javax.resource.ResourceException: Interrupted while requesting permit! Waited 1 ms, invocation time: 1081438312365
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:259)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:496)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:425)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:318)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:477)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
      at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createQueueSession(JmsSessionFactoryImpl.java:119)
      at com.XXXXX.XXXXXX.core.common.JmsReceiverBean.receive(JmsReceiverBean.java:78)
      at com.XXXXX.XXXXXX.core.common.JmsReceiverBean.receive(JmsReceiverBean.java:126)

      In our code line 78 is:

      session = queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

      queueConnection is a transient attribute of our session bean. We open the connection when the bean is created/activated and we close it when the bean is passivated/removed.

      I took thread dump and everything is normal

      Could it be a Jboss bug?

      Regards,

      Stephane

        • 1. Re: Interrupted while requesting permit!
          Stephane Nicoll Master

          I forgot to mention that we use java:/JmsXA as connection factory.

          Regards,

          Stephane

          • 2. Re: Interrupted while requesting permit!
            Elias Ross Master

            I've been seeing this, having done some recent performance testing on JBoss 3.2.3. I suspect this is a JBoss bug. This happens after about 50,000 message processed by a MDB which is using the java:/JmsXA connection factory (transacted.)

            I'm not sure why the connection pool would block; why wouldn't it be unlimited in size?

            2004-04-07 19:09:35,177 ERROR [JmsSessionFactoryImpl] (Thread Pool Worker-165)
            could not create session
            javax.resource.ResourceException: Interrupted while requesting permit! Waited 5
            ms, invocation time: 1081364975159
             at
            org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:259)
             at
            org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:496)
             at
            org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:425)
             at
            org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:318)
             at
            org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:477)
             at
            org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
            
             at
            org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:477)
             at
            org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
             at
            org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createQueueSession(JmsSessionFactoryImpl.java:119)


            • 3. Re: Interrupted while requesting permit!
              Adrian Brock Master

              The default pool size is 20
              There is an *implicit*

              <max-pool-size>20</max-pool-size>
              

              in jms-ds.xml

              The interrupt is a transaction timeout.

              Allocating a connection for the lifetime of the bean is not a very good use of resources.
              The things are pooled for gods sake, just open and close them as you need them,
              they don't get really closed.

              Regards,
              Adrian

              • 4. Re: Interrupted while requesting permit!
                Stephane Nicoll Master

                Hey Adrian,

                So you suggest to open/close the connection every time I need access to the queue. Well ok but could it be the cause of my problem?

                I don't get you with this pool size settings. My scenario is:

                RequresNew - New transaction is created
                - Create session
                - Create receiver
                - Read message
                - Do some stuff with it
                - Close receiver
                - Close session

                With a pool of 1 it should work right?

                Regards,

                Stephane

                • 5. Re: Interrupted while requesting permit!
                  Stephane Nicoll Master

                  Also what are the benefit (and drawbacks) of changing the max-pool-size setting.

                  Regards,

                  Stephane

                  • 6. Re: Interrupted while requesting permit!
                    Adrian Brock Master

                    Controlling the number of concurrent requests.
                    It uses strict pooling. This should be combined with the

                    <attribute name="blocking-timeout-millis>5000</attribute>
                    

                    to control how long threads waits if there are no connections available.


                    • 7. Re: Interrupted while requesting permit!
                      pward Newbie

                      I'm seeing this issue at a client with 3.2.3. I've tried changing the max-pool-size to 5000 with no effect.

                      It looks like (based on jboss-ds_1_0.dtd) that the blocking timeout value should be specified in [jboss_home]\server\default\[config]\deploy\jms\jms-ds.xml as

                      <connection-factories>
                      
                       ... stuff ...
                      
                       <tx-connection-factory>
                      
                       ... stuff ...
                      
                       <max-pool-size>5000</max-pool-size>
                      
                       <blocking-timeout-millis>5000</blocking-timeout-millis>
                      
                       </tx-connection-factory>
                      
                      </connection-factories>
                      


                      Can you confirm this?

                      Thanks in advance,
                      Paul

                      • 8. Re: Interrupted while requesting permit!
                        Raja Master

                        Paul, Yes that should work. This is based on the concurrent.jar that gets a permit waiting for the timeout second u provide in the -ds.xml