You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "kimm king (JIRA)" <ji...@apache.org> on 2012/12/28 07:30:14 UTC

[jira] [Commented] (AMQ-796) Client may shtudown when failover connection is reconnecting. We need to maintain at least 1 non-daemon thread alive.

    [ https://issues.apache.org/jira/browse/AMQ-796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13540358#comment-13540358 ] 

kimm king commented on AMQ-796:
-------------------------------

This issue occurs again on the trunk and Version 5.7.0.
Using:
1. start a broker in command line
2. create and run a connection with a consumer and TransportListener(for track reconnecting) in eclipse
3. stop the broker and restart the broker
4. then we can see client transportInterupted and transportResumed
5. stop the broker again 
6. the client process will quit!!!

The early fix for this bug is to remove daemon=true on ActiveMQ Connection Executor,
but sometimes this executor does not create new thread.

The solution is to make the reconnectTask thread is non-daemon:
// FailoverTransport.java row: 132 
reconnectTaskFactory = new TaskRunnerFactory();
reconnectTaskFactory.setDaemon(false); // to set daemon=false by kimmking
reconnectTaskFactory.init();

After the fix, the reconnecting of this client works well during broker's stop for many times.
                
> Client may shtudown when failover connection is reconnecting.  We need to maintain at least 1 non-daemon thread alive.
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-796
>                 URL: https://issues.apache.org/jira/browse/AMQ-796
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.0, 5.3.0
>            Reporter: Hiram Chirino
>            Assignee: Rob Davies
>             Fix For: 5.6.0, 4.0.3
>
>         Attachments: AMQ-796.cmd, jstack_amq_5.6.0
>
>
> Dejan Reported on the User lists:
> Hi,
> after some experiments I found that this problem only exists if there are no
> other threads in the application. It seems like connection thread dies
> before it manages to reconnect. By starting another thread in the
> application, it succeeds to recover from master failure and reconnect to the
> slave broker. So I have a workaround for now, but it would be nice to make
> this work even for simple (single-threaded) clients.
> Regards,
> Dejan

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira