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

ASF subversion and git services commented on ARTEMIS-5107:
----------------------------------------------------------

Commit 3101ac59e09c8722f5afc378162a07f518fc7fe9 in activemq-artemis's branch 
refs/heads/main from Justin Bertram
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=3101ac59e0 ]

ARTEMIS-5107 using wrong value in ReplicationStartSyncMessage ctor

The incorrect value has always been used for the `beforeTwoEighteen`
variable. However, this is not actually a problem because the
`beforeTwoEighteen` variable is not necessary. It's only job is to
prevent newer versions from sending extra data to older versions.
However, older version will simply ignore the extra data which means
the `beforeTwoEighteen` variable can be removed completely.

This same compatibility pattern is used in many places for the Core
protocol.

The tests added with the original fix successfully reproduced the
original problem and those tests still pass even with this variable
removed. Also, keep in mind that `decodeRest` is still checking the
version so that it doesn't try to read data that doesn't exist from an
older version.


> Using uninitialized value in ReplicationStartSyncMessage
> --------------------------------------------------------
>
>                 Key: ARTEMIS-5107
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5107
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Pavel Nekrasov
>            Assignee: Justin Bertram
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> In lines 
> [77-80|https://github.com/apache/activemq-artemis/blob/8e4bc33dc4d7b4d2031c1bda996c7ce002a3d0e8/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java#L77-L80],
>  an uninitialized value {{synchronizationIsFinished}} is assigned, while the 
> {{beforeTwoEighteen}} parameter passed to the constructor is not used.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to