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

ASF GitHub Bot commented on ARTEMIS-1187:
-----------------------------------------

Github user TomasHofman commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1298#discussion_r119296506
  
    --- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
 ---
    @@ -686,7 +686,7 @@ protected CreateSessionMessage newCreateSession(String 
username,
                                                        boolean autoCommitSends,
                                                        boolean autoCommitAcks,
                                                        boolean preAcknowledge) 
{
    -      return new CreateSessionMessage(name, sessionChannel.getID(), 
VersionLoader.getVersion().getIncrementingVersion(), username, password, 
minLargeMessageSize, xa, autoCommitSends, autoCommitAcks, preAcknowledge, 
confirmationWindow, null);
    +      return new CreateSessionMessage(name, sessionChannel.getID(), 
serverVersion, username, password, minLargeMessageSize, xa, autoCommitSends, 
autoCommitAcks, preAcknowledge, confirmationWindow, null);
    --- End diff --
    
    The ```newCreateSession()``` is only called in ```recreateSession()``` 
method, so my reasoning was that the message will be sent to the same server 
that the client was previously connected to (is that correct?), so the 
serverVersion that was previously established can be reused.
    
    The alternative could be to start a cycle of CreateSessionMessages with the 
highest know version and decrease the version if 
```ActiveMQIncompatibleClientServerException``` is returned? I think this is 
how establishing new connection works.


> Incompatible version when recreating a session with older server
> ----------------------------------------------------------------
>
>                 Key: ARTEMIS-1187
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1187
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Tomas Hofman
>
> 1.5.x client is able to connect to 1.1.x server. However, when server is 
> reloaded following error occurs:
> {noformat}
>     11:42:29,400 Thread-0 (ActiveMQ-client-global-threads-1319762469) ERROR 
> [org.apache.activemq.artemis.core.client.impl.ClientSessionImpl:993] 
> AMQ214003: Failed to handle failover
>     
> ActiveMQIncompatibleClientServerException[errorType=INCOMPATIBLE_CLIENT_SERVER_VERSIONS
>  message=AMQ119033: Server and client versions incompatible]
>             at 
> org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:407)
>             at 
> org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:318)
>             at 
> org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.recreateSession(ActiveMQSessionContext.java:637)
>             at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.handleFailover(ClientSessionImpl.java:958)
>             at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.reconnectSessions(ClientSessionFactoryImpl.java:771)
>             at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.failoverOrReconnect(ClientSessionFactoryImpl.java:614)
>             at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.handleConnectionFailure(ClientSessionFactoryImpl.java:504)
>             at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.access$500(ClientSessionFactoryImpl.java:72)
>             at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$DelegatingFailureListener.connectionFailed(ClientSessionFactoryImpl.java:1165)
>             at 
> org.apache.activemq.artemis.spi.core.protocol.AbstractRemotingConnection.callFailureListeners(AbstractRemotingConnection.java:67)
>             at 
> org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.fail(RemotingConnectionImpl.java:207)
>             at 
> org.apache.activemq.artemis.spi.core.protocol.AbstractRemotingConnection.fail(AbstractRemotingConnection.java:215)
>             at 
> org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$CloseRunnable.run(ClientSessionFactoryImpl.java:996)
>             at 
> org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:101)
>             at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>             at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>             at java.lang.Thread.run(Thread.java:745)
> {noformat}
> This works correctly with 1.5 server and old 1.1 client.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to