You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Tomasz Wiczling (JIRA)" <ji...@apache.org> on 2009/05/06 12:43:39 UTC

[jira] Commented: (AMQNET-152) Infinit exception at reconnect on Mono with failover transport.

    [ https://issues.apache.org/activemq/browse/AMQNET-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51533#action_51533 ] 

Tomasz Wiczling commented on AMQNET-152:
----------------------------------------

I've checked it once again with:
- https://svn.apache.org/repos/asf/activemq/activemq-dotnet/  rev. 772134
- Mono 2.4 on Windows Server 2003
- apache-activemq-5.3-SNAPSHOT
The test program was compiled with MS Visual Studio 2008 - Release configuration

The problem remains!!! (output below)

The problematic situation occurs not when the server is stopped at application start, as you tested (this case is correct), but when the application make successful connection to the server and then the server restarts.

Output:

>"c:\Program Files (x86)\Mono-2.4\bin\mono.exe" IssueExampleMSVS2008.exe failover:(tcp://192.168.44.244:61616) test.topic

DEBUG:Reconnect was triggered but transport is not started yet. Wait for start to connect the transport.

DEBUG:Started.

DEBUG:Creating reconnect task

DEBUG:Waking up reconnect task

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connected to 192.168.44.244:61616 using 192.168.44.244 protocol.

DEBUG:Parsing type: 1 with: Apache.NMS.ActiveMQ.OpenWire.V1.WireFormatInfoMarshaller

DEBUG:Parsing type: 2 with: Apache.NMS.ActiveMQ.OpenWire.V2.BrokerInfoMarshaller

DEBUG:Connection established

INFO:Successfully connected to: tcp://192.168.44.244:61616/

DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller

DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller

DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller

DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller

INFO:Starting dispatcher thread for session

INFO:Starting dispatcher thread for session

INFO:Dispatcher thread started

INFO:Dispatcher thread started

Successfully connected to Topic 'test.topic' on 'failover:(tcp://192.168.44.244:61616)' - waiting Any Key to be pressed


WARN:Transport failed to tcp://192.168.44.244:61616/, attempting to automatically reconnect due to: Failed to read past end of stream.

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: The operation completed successfully.



DEBUG:Waiting 10ms before attempting connection.

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: The operation completed successfully.



DEBUG:Waiting 20ms before attempting connection.

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: The operation completed successfully.



DEBUG:Waiting 40ms before attempting connection.

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: The operation completed successfully.



DEBUG:Waiting 80ms before attempting connection.

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: The operation completed successfully.



DEBUG:Waiting 160ms before attempting connection.

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: The operation completed successfully.



DEBUG:Waiting 320ms before attempting connection.

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: The operation completed successfully.



DEBUG:Waiting 640ms before attempting connection.

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connected to 192.168.44.244:61616 using 192.168.44.244 protocol.

DEBUG:Parsing type: 1 with: Apache.NMS.ActiveMQ.OpenWire.V1.WireFormatInfoMarshaller

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: Cannot cast from source type to destination type.

DEBUG:Waiting 1280ms before attempting connection.

DEBUG:Parsing type: 2 with: Apache.NMS.ActiveMQ.OpenWire.V2.BrokerInfoMarshaller



DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller

ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=1 ]

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connected to 192.168.44.244:61616 using 192.168.44.244 protocol.

DEBUG:Parsing type: 1 with: Apache.NMS.ActiveMQ.OpenWire.V1.WireFormatInfoMarshaller

DEBUG:Parsing type: 2 with: Apache.NMS.ActiveMQ.OpenWire.V2.BrokerInfoMarshaller



DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: Cannot cast from source type to destination type.

DEBUG:Waiting 2560ms before attempting connection.

DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller

ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=1 ]

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connected to 192.168.44.244:61616 using 192.168.44.244 protocol.

DEBUG:Parsing type: 1 with: Apache.NMS.ActiveMQ.OpenWire.V1.WireFormatInfoMarshaller

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: Cannot cast from source type to destination type.

DEBUG:Parsing type: 2 with: Apache.NMS.ActiveMQ.OpenWire.V2.BrokerInfoMarshaller



DEBUG:Waiting 5120ms before attempting connection.

DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller

ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=1 ]

DEBUG:Attempting connect to: tcp://192.168.44.244:61616/

DEBUG:Opening socket to: 192.168.44.244 on port: 61616

DEBUG:Connected to 192.168.44.244:61616 using 192.168.44.244 protocol.

DEBUG:Parsing type: 1 with: Apache.NMS.ActiveMQ.OpenWire.V1.WireFormatInfoMarshaller

DEBUG:Connect fail to: tcp://192.168.44.244:61616/, reason: Cannot cast from source type to destination type.

DEBUG:Waiting 10240ms before attempting connection.

DEBUG:Parsing type: 2 with: Apache.NMS.ActiveMQ.OpenWire.V2.BrokerInfoMarshaller



DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller

ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=1 ]



ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=5 ]


INFO:Stopping dispatcher thread for session

INFO:Dispatcher thread stopped

INFO:Dispatcher thread joined

ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=6 ]

INFO:Stopping dispatcher thread for session

INFO:Dispatcher thread stopped

INFO:Dispatcher thread joined

ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=7 ]

ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=8 ]

Connected and Disconnected successfully to Topic 'test.topic' on 'failover:(tcp://192.168.44.244:61616)'



> Infinit exception at reconnect on Mono with failover transport.
> ---------------------------------------------------------------
>
>                 Key: AMQNET-152
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-152
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: ActiveMQ Client
>         Environment: Mono 1.9.1 framework on both Windows/Linux system.
>            Reporter: Tomasz Wiczling
>            Assignee: Jim Gomes
>             Fix For: 1.1
>
>
> I'm testing failover transport on Mono.
> I've downloaded latest revision of ActiveMQ .Net project (rev. 752559).
> I've made tests on:
> - both Windows and Linux
> - Mono 1.9.1 and Mono 2.0
> - ActiveMQ 5.1 and ActiveMQ 5.2
> All test ended with an exception.
> I wrote simple program that was listening on topic.
> namespace IssueExample
> {
>         internal class ConsoleTracer : ITrace
>         {
>                 public bool IsDebugEnabled { get { return true; } }
>                 public bool IsInfoEnabled { get { return true; } }
>                 public bool IsWarnEnabled { get { return true; } }
>                 public bool IsErrorEnabled { get { return true; } }
>                 public bool IsFatalEnabled { get { return true; } }
>                 public void Debug(string message) { Console.WriteLine("DEBUG:" + message); }
>                 public void Info(string message) { Console.WriteLine("INFO:" + message); }
>                 public void Warn(string message) { Console.WriteLine("WARN:" + message); }
>                 public void Error(string message) { Console.WriteLine("ERROR:" + message); }
>                 public void Fatal(string message) { Console.WriteLine("FATAL:" + message); }
>         }
>         class Program
>         {
>                 public static void Main(string[] args)
>                 {
>                         if (args.Length < 2)
>                         {
>                                 Console.WriteLine("USAGE: IssueExample <AMQURI> <TOPIC_NAME>");
>                                 return;
>                         }
>                         Tracer.Trace = new ConsoleTracer();
>                         IConnectionFactory factory = new ConnectionFactory(args[0]);
>                         IConnection connection = factory.CreateConnection();
>                         ISession session = connection.CreateSession();
>                         IDestination destination = session.GetTopic(args[1]);
>                         IMessageConsumer consumer = session.CreateConsumer(destination);
>                         consumer.Listener += onMessage;
>                         connection.Start();
>                         Console.WriteLine("Successfully connected to Topic '" + args[1] + "' on '" + args[0] + "' - waiting Any Key to be pressed");
>                         Console.ReadKey();
>                         consumer.Close();
>                         connection.Dispose();
>                         Console.WriteLine("Connected and Disconnected successfully toTopic '" + args[1] + "' on '" + args[0] + "' - Press any key to terminate program.");
>                         Console.ReadKey();
>                 }
>                 private static void onMessage(IMessage msg)
>                 {
>                         Console.WriteLine("\tRECEIVING: " + msg);
>                 }
>         }
> }
> The test was made with execution:
> # mono IssueExample.exe failover:(tcp://localhost:61616) test.topic
> Program works fine till the test of reconnection.
> While the program is running I restart the AMQ server.
> For a while I get loop of:
> (...)
> DEBUG:Waiting 1280 ms before attempting connection.
> DEBUG:Attempting connect to: tcp://localhost:61616/
> DEBUG:Opening socket to: localhost on port: 61616
> DEBUG:Connect fail to: tcp://localhost:61616/, reason: System.Net.Sockets.SocketException: Connection refused
>   at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remote_end) [0x00000]
>   at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransportFactory.Connect (System.String host, Int32 port) [0x00000]
>   at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransportFactory.CompositeConnect (System.Uri location) [0x00000]
>   at Apache.NMS.ActiveMQ.Transport.TransportFactory.CompositeConnect (System.Uri location) [0x00000]
>   at Apache.NMS.ActiveMQ.Transport.Failover.FailoverTransport.doReconnect () [0x00000]
> (...)
> And it is OK, but ...
> When server resumes work, I get:
> (...)
> DEBUG:Waiting 20480 ms before attempting connection.
> DEBUG:Parsing type: 2 with: Apache.NMS.ActiveMQ.OpenWire.V2.BrokerInfoMarshaller
> DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller
> ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=1 ]
> DEBUG:Parsing type: 10 with: Apache.NMS.ActiveMQ.OpenWire.V2.KeepAliveInfoMarshaller
> INFO:Keep alive message received.
> INFO:Waiting for transport to reconnect.
> DEBUG:Attempting connect to: tcp://localhost:61616/
> DEBUG:Opening socket to: localhost on port: 61616
> DEBUG:Parsing type: 1 with: Apache.NMS.ActiveMQ.OpenWire.V1.WireFormatInfoMarshaller
> DEBUG:Connect fail to: tcp://localhost:61616/, reason: System.InvalidCastException: Cannot cast from source type to destination type.
>   at System.Collections.Generic.Dictionary`2+ValueCollection[Apache.NMS.ActiveMQ.Commands.SessionId,Apache.NMS.ActiveMQ.State.SessionState].System.Collections.ICollection.CopyTo (System.Array array, Int32 index) [0x00000]
>   at System.Collections.ArrayList.InsertRange (Int32 index, ICollection c) [0x00000]
>   at System.Collections.ArrayList.AddRange (ICollection c) [0x00000]
>   at System.Collections.ArrayList..ctor (ICollection c) [0x00000]
>   at Apache.NMS.ActiveMQ.State.SynchronizedCollection`1[Apache.NMS.ActiveMQ.State.SessionState]..ctor (ICollection c) [0x00000]
>   at Apache.NMS.ActiveMQ.State.SynchronizedDictionary`2[Apache.NMS.ActiveMQ.Commands.SessionId,Apache.NMS.ActiveMQ.State.SessionState].get_Values () [0x00000]
>   at Apache.NMS.ActiveMQ.State.ConnectionState.get_SessionStates () [0x00000]
>   at Apache.NMS.ActiveMQ.State.ConnectionStateTracker.DoRestoreSessions (ITransport transport, Apache.NMS.ActiveMQ.State.ConnectionState connectionState) [0x00000]
>   at Apache.NMS.ActiveMQ.State.ConnectionStateTracker.DoRestore (ITransport transport) [0x00000]
>   at Apache.NMS.ActiveMQ.Transport.Failover.FailoverTransport.restoreTransport (ITransport t) [0x00000]
>   at Apache.NMS.ActiveMQ.Transport.Failover.FailoverTransport.doReconnect () [0x00000]
> (...)
> And this is permanent state.

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