Mule
  1. Mule
  2. MULE-4251

Connector workManager's should be disposed in stop phase before transport itself is stopped.

    Details

    • User impact:
      High
    • Log Output:
      Hide
      [03-11 23:13:28] ERROR DefaultExceptionStrategy [jmsConnector.dispatcher.7]: Caught exception in Exception Strategy: The producer is closed
      javax.jms.IllegalStateException: The producer is closed
      at org.apache.activemq.ActiveMQMessageProducer.checkClosed(ActiveMQMessageProducer.java:333)
      at org.apache.activemq.ActiveMQMessageProducer.getDestination(ActiveMQMessageProducer.java:297)
      at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:384)
      at org.mule.transport.jms.Jms102bSupport.send(Jms102bSupport.java:244)
      at org.mule.transport.jms.JmsMessageDispatcher.dispatchMessage(JmsMessageDispatcher.java:219)
      at org.mule.transport.jms.JmsMessageDispatcher.doDispatch(JmsMessageDispatcher.java:72)
      at org.mule.transport.AbstractMessageDispatcher$Worker.run(AbstractMessageDispatcher.java:262)
      at org.mule.work.WorkerContext.run(WorkerContext.java:310)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
      at java.lang.Thread.run(Thread.java:613)

      Show
      [03-11 23:13:28] ERROR DefaultExceptionStrategy [jmsConnector.dispatcher.7]: Caught exception in Exception Strategy: The producer is closed javax.jms.IllegalStateException: The producer is closed at org.apache.activemq.ActiveMQMessageProducer.checkClosed(ActiveMQMessageProducer.java:333) at org.apache.activemq.ActiveMQMessageProducer.getDestination(ActiveMQMessageProducer.java:297) at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:384) at org.mule.transport.jms.Jms102bSupport.send(Jms102bSupport.java:244) at org.mule.transport.jms.JmsMessageDispatcher.dispatchMessage(JmsMessageDispatcher.java:219) at org.mule.transport.jms.JmsMessageDispatcher.doDispatch(JmsMessageDispatcher.java:72) at org.mule.transport.AbstractMessageDispatcher$Worker.run(AbstractMessageDispatcher.java:262) at org.mule.work.WorkerContext.run(WorkerContext.java:310) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575) at java.lang.Thread.run(Thread.java:613)
    • Similar Issues:
      MULE-4268Retry should not stop/start connector
      MULE-2616MuleWorkManager is stopped after JMS reconnection
      MULE-6769MuleContext.dispose should call stop on started connectors and then dispose
      MULE-2113Lifecycle phases should be in pairs
      MULE-4358The ExecutorService used for PollingMessageReceiver's scheduler is not correctly/fully shutdown when the connector is stopped/disposed
      MULE-5384SedaService workManager is stopped before queue polling thread exits and messages are lost
      MULE-4868AbstractLifecycleManager should dispose initialized objects directly
      MULE-3727MuleShutdownHook should stop/dispose muleContext
      MULE-111Stop and dispose lifecycle methods not working on components
      MULE-1546JMS "Not connected" when stopping Mule under load

      Description

      Disposal of the workManagers in stop() before the transport itself has been stopped allows jobs to complete and dispatch before the transport is stopped. Currently messages randomly get lost (based on timing) with errors because there are still pending dispatcher jobs when the transport implementation is stopped.

      Example of error is shown below.

        Issue Links

          Activity

          Show
          Daniel Feist added a comment - http://svn.mule.codehaus.org/changelog/mule/branches/mule-2.x?cs=14267
          Hide
          Daniel Feist added a comment -

          This fix correct things, but if for some reason someone tries to send a message when connecter has been stopped this will result in a NullPointerException.

          This wouldn't happen if it wasn't for MULE-4254, but we need to decide if we want to fix MULE-4254 across the board or only in/for transport where the concept of start/stop applies.

          Show
          Daniel Feist added a comment - This fix correct things, but if for some reason someone tries to send a message when connecter has been stopped this will result in a NullPointerException. This wouldn't happen if it wasn't for MULE-4254 , but we need to decide if we want to fix MULE-4254 across the board or only in/for transport where the concept of start/stop applies.
          Hide
          Daniel Feist added a comment -

          This will need to be fixed properly in 3.0. For 2.2 we can implement some workarounds so that retry is not affected by this fix.

          Show
          Daniel Feist added a comment - This will need to be fixed properly in 3.0. For 2.2 we can implement some workarounds so that retry is not affected by this fix.
          Show
          Travis Carlson added a comment - 2.1.x: http://fisheye.codehaus.org/changelog/mule/?cs=14945 http://fisheye.codehaus.org/changelog/mule/?cs=14947 2.2.x: http://fisheye.codehaus.org/changelog/mule/?cs=14946 http://fisheye.codehaus.org/changelog/mule/?cs=14948

            People

            • Assignee:
              Travis Carlson
              Reporter:
              Daniel Feist
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development