You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Hari (JIRA)" <ji...@apache.org> on 2008/05/27 11:36:54 UTC

[jira] Created: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

ActiveMQ server does not release the connection on a reconnect
--------------------------------------------------------------

                 Key: AMQ-1746
                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
             Project: ActiveMQ
          Issue Type: Bug
          Components: Connector
    Affects Versions: 5.2.0
         Environment: Redhat Linux , jdk 1.5_0_6
            Reporter: Hari


I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.

tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 

The server is 10.1.30.60:51616. 



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by Gul <sg...@i2cinc.com>.
hi!!
 
When i disable the network i got the following exception at activemq
console, after network connection has established again, the javascript
application running on same machine (where server is running also) works
fine but the other machines running same javascript application  connected
to my machine(server running on my machine) unable to work properly.. in
this case all handlers are lost which are establised using
amq.addListener("id", myTopic, myHandler); MessageListenerServlet fail to
get JMS response 

ERROR MulticastDiscoveryAgent        - Failed to advertise our service:
default.
ActiveMQ-4.alive.%localhost%tcp://sgul:61616
java.net.NoRouteToHostException: No route to host: Datagram send failed
        at java.net.PlainDatagramSocketImpl.send(Native Method)
        at java.net.DatagramSocket.send(DatagramSocket.java:612)
        at
org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryA
gent.doAdvertizeSelf(MulticastDiscoveryAgent.java:361)
        at
org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryA
gent.doTimeKeepingServices(MulticastDiscoveryAgent.java:345)
        at
org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryA
gent.run(MulticastDiscoveryAgent.java:307)
        at java.lang.Thread.run(Thread.java:595)





JIRA jira@apache.org wrote:
> 
> 
>     [
> https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43371#action_43371
> ] 
> 
> Hari commented on AMQ-1746:
> ---------------------------
> 
> saira, i think an exception would be thrown on the clientside when a
> disconnect happens, in which case you will have to manually reconnect to
> the server. 
> 
>> ActiveMQ server does not release the connection on a reconnect
>> --------------------------------------------------------------
>>
>>                 Key: AMQ-1746
>>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>>             Project: ActiveMQ
>>          Issue Type: Bug
>>          Components: Connector
>>    Affects Versions: 5.2.0
>>         Environment: Redhat Linux , jdk 1.5_0_6
>>            Reporter: Hari
>>            Assignee: Rob Davies
>>
>> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq
>> as of 20080521. I am using apacha nms.net client. On a connect it
>> receives messages and on a regular shutdown the connection is
>> disconnected and everything shutsdown w.r.t that connection in the server
>> side. Now if there is network issue or when we disable and enable the
>> network from the client side , a reconnect request is sent with a new
>> clientid and the connection is established.But the old connection is
>> still active which is evident from a netstat on the server machine. The
>> client side netstat shows only the latest connection which is on port
>> 1870.
>> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828    
>> ESTABLISHED 
>> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870    
>> ESTABLISHED 
>> The server is 10.1.30.60:51616. 
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-jira--Created%3A-%28AMQ-1746%29-ActiveMQ-server-does-not-release-the-connection-on-a-reconnect-tp17486710p17752205.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


[jira] Commented: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by "Saira Gul (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43375#action_43375 ] 

Saira Gul commented on AMQ-1746:
--------------------------------

hi!! 
  
When i disable the network i got the following exception at activemq console, after network connection has established again, the javascript application running on same machine (where server is running also) works fine but the other machines running same javascript application  connected to my machine(server running on my machine) unable to work properly.. in this case all handlers are lost which are establised using amq.addListener("id", myTopic, myHandler); MessageListenerServlet fail to get JMS response 

ERROR MulticastDiscoveryAgent        - Failed to advertise our service: default. 
ActiveMQ-4.alive.%localhost%tcp://sgul:61616 
java.net.NoRouteToHostException: No route to host: Datagram send failed 
        at java.net.PlainDatagramSocketImpl.send(Native Method) 
        at java.net.DatagramSocket.send(DatagramSocket.java:612) 
        at org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryA 
gent.doAdvertizeSelf(MulticastDiscoveryAgent.java:361) 
        at org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryA 
gent.doTimeKeepingServices(MulticastDiscoveryAgent.java:345) 
        at org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryA 
gent.run(MulticastDiscoveryAgent.java:307) 
        at java.lang.Thread.run(Thread.java:595) 


Quoted from: 
http://www.nabble.com/-jira--Created%3A-%28AMQ-1746%29-ActiveMQ-server-does-not-release-the-connection-on-a-reconnect-tp17486710p17751779.html



> ActiveMQ server does not release the connection on a reconnect
> --------------------------------------------------------------
>
>                 Key: AMQ-1746
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.2.0
>         Environment: Redhat Linux , jdk 1.5_0_6
>            Reporter: Hari
>            Assignee: Rob Davies
>
> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 
> The server is 10.1.30.60:51616. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by "Hari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43371#action_43371 ] 

Hari commented on AMQ-1746:
---------------------------

saira, i think an exception would be thrown on the clientside when a disconnect happens, in which case you will have to manually reconnect to the server. 

> ActiveMQ server does not release the connection on a reconnect
> --------------------------------------------------------------
>
>                 Key: AMQ-1746
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.2.0
>         Environment: Redhat Linux , jdk 1.5_0_6
>            Reporter: Hari
>            Assignee: Rob Davies
>
> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 
> The server is 10.1.30.60:51616. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by "Hari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43243#action_43243 ] 

Hari commented on AMQ-1746:
---------------------------

I have been working on this for a while now.  I tried a bunch of things. 

1) i made changes to RegionBroker.java in the addconnection so when a new connection request comes in and there is a oldcontext associated with the clientid then to explicitly close the old connection by getting it from the oldcontext and closing it. this solves the problem of having multiple connections on the server side to a client who has one connection from his side.

In a scenario where a client is disconnected for some reason(unpluggint he cable or the system crashing) and if there is no reconnect at all, there is noway the server knows to close the connection. server keeps sending to that connection. the outqueue on the socket increases to close to 98000 and then the server does not serve the other connected clients as well.

> ActiveMQ server does not release the connection on a reconnect
> --------------------------------------------------------------
>
>                 Key: AMQ-1746
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.2.0
>         Environment: Redhat Linux , jdk 1.5_0_6
>            Reporter: Hari
>
> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 
> The server is 10.1.30.60:51616. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by "Saira Gul (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43370#action_43370 ] 

Saira Gul commented on AMQ-1746:
--------------------------------

hi!!
 I am using activeMQ supports for Ajax in my application. i've created queues like amq.sendMessage("queueName", message);
 and to receive a message i've added listener like amq.addListener(myId, myDestination, myHandler.revMessage);

 When i send request with amq.sendMessage("queueName", message); it will make JMS message, fetch response and 
 send the message back to myHandler. this code works fine.. 

the problem is that if network connection lost, all handlers will also lost and the handlers would not be able to get response back from JMS.. requests are getting fine to activeMQ server and the response is also generating and MessageListenerServlet fail to send back response to javascript...

Is there any way to activate handlers again when network connection got enabled after disabled.

Thank you

Quoted from: 
http://www.nabble.com/-jira--Created%3A-%28AMQ-1746%29-ActiveMQ-server-does-not-release-the-connection-on-a-reconnect-tp17486710p17486710.html



> ActiveMQ server does not release the connection on a reconnect
> --------------------------------------------------------------
>
>                 Key: AMQ-1746
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.2.0
>         Environment: Redhat Linux , jdk 1.5_0_6
>            Reporter: Hari
>            Assignee: Rob Davies
>
> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 
> The server is 10.1.30.60:51616. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dejan Bosanac resolved AMQ-1746.
--------------------------------

    Resolution: Cannot Reproduce

On the nms client reconnect issue, we didn't manage to reproduce it. can you try the latest versions of the broker and nms lib and see if you still see the problem. If you do, please provide a test case or a step-by-step guide how to reproduce it.

> ActiveMQ server does not release the connection on a reconnect
> --------------------------------------------------------------
>
>                 Key: AMQ-1746
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.2.0
>         Environment: Redhat Linux , jdk 1.5_0_6
>            Reporter: Hari
>            Assignee: Dejan Bosanac
>             Fix For: NEEDS_REVIEWED
>
>
> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 
> The server is 10.1.30.60:51616. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by "Rob Davies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Davies reassigned AMQ-1746:
-------------------------------

    Assignee: Rob Davies

> ActiveMQ server does not release the connection on a reconnect
> --------------------------------------------------------------
>
>                 Key: AMQ-1746
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.2.0
>         Environment: Redhat Linux , jdk 1.5_0_6
>            Reporter: Hari
>            Assignee: Rob Davies
>
> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 
> The server is 10.1.30.60:51616. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by "Hari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43244#action_43244 ] 

Hari commented on AMQ-1746:
---------------------------

Then also i tried to set the setKeepAlive on the socket to true and also lowered the server's timeout, keepalivetime and no of probes to low no's (in the RH linux config)so the system will knock off the connection. but even this does not seem to help.

> ActiveMQ server does not release the connection on a reconnect
> --------------------------------------------------------------
>
>                 Key: AMQ-1746
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.2.0
>         Environment: Redhat Linux , jdk 1.5_0_6
>            Reporter: Hari
>
> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 
> The server is 10.1.30.60:51616. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by "Rob Davies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Davies reassigned AMQ-1746:
-------------------------------

    Assignee: Dejan Bosanac  (was: Rob Davies)

> ActiveMQ server does not release the connection on a reconnect
> --------------------------------------------------------------
>
>                 Key: AMQ-1746
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.2.0
>         Environment: Redhat Linux , jdk 1.5_0_6
>            Reporter: Hari
>            Assignee: Dejan Bosanac
>             Fix For: NEEDS_REVIEWED
>
>
> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 
> The server is 10.1.30.60:51616. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1746) ActiveMQ server does not release the connection on a reconnect

Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60618#action_60618 ] 

Dejan Bosanac commented on AMQ-1746:
------------------------------------

On the Ajax issue, can you upgrade to the latest release and try to use it with multicast turned off?

> ActiveMQ server does not release the connection on a reconnect
> --------------------------------------------------------------
>
>                 Key: AMQ-1746
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1746
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.2.0
>         Environment: Redhat Linux , jdk 1.5_0_6
>            Reporter: Hari
>            Assignee: Dejan Bosanac
>             Fix For: NEEDS_REVIEWED
>
>
> I have tried this with activemq 5.0,5.1 and latest snapshot of activemq as of 20080521. I am using apacha nms.net client. On a connect it receives messages and on a regular shutdown the connection is disconnected and everything shutsdown w.r.t that connection in the server side. Now if there is network issue or when we disable and enable the network from the client side , a reconnect request is sent with a new clientid and the connection is established.But the old connection is still active which is evident from a netstat on the server machine. The client side netstat shows only the latest connection which is on port 1870.
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1828     ESTABLISHED 
> tcp        0      0 ::ffff:10.1.30.60:51616     ::ffff:10.1.30.176:1870     ESTABLISHED 
> The server is 10.1.30.60:51616. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.