This is an automated email from the ASF dual-hosted git repository.
zstan pushed a commit to branch ignite-2.18
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/ignite-2.18 by this push:
new 7cea6936372 IGNITE-28337 Fix serialization of
TcpDiscoveryNodeAddedMessage in RingMessageWorker#sendMessageToClients (#13013)
7cea6936372 is described below
commit 7cea6936372624281bd165690b4959f7067911ca
Author: Aleksandr Chesnokov <[email protected]>
AuthorDate: Thu Apr 16 13:29:43 2026 +0300
IGNITE-28337 Fix serialization of TcpDiscoveryNodeAddedMessage in
RingMessageWorker#sendMessageToClients (#13013)
---
.../ignite/spi/discovery/tcp/ServerImpl.java | 28 ++++++++++++++--------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 9f349a12212..954d1e6d435 100644
---
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -3255,21 +3255,20 @@ class ServerImpl extends TcpDiscoveryImpl {
if (clientMsgWorkers.isEmpty())
return;
- byte[] msgBytes = null;
+ byte[] msgBytes;
- if (!(msg instanceof TcpDiscoveryNodeAddedMessage)) {
- try {
- msgBytes = clientMsgSer.serializeMessage(msg);
- }
- catch (IgniteCheckedException | IOException e) {
- U.error(log, "Failed to serialize message: " + msg, e);
+ try {
+ msgBytes = clientMsgSer.serializeMessage(msg);
+ }
+ catch (IgniteCheckedException | IOException e) {
+ U.error(log, "Failed to serialize message: " + msg, e);
- return;
- }
+ return;
}
for (ClientMessageWorker clientMsgWorker :
clientMsgWorkers.values()) {
TcpDiscoveryAbstractMessage msg0 = msg;
+ byte[] msgBytes0 = msgBytes;
if (msg instanceof TcpDiscoveryNodeAddedMessage) {
TcpDiscoveryNodeAddedMessage nodeAddedMsg =
(TcpDiscoveryNodeAddedMessage)msg;
@@ -3278,10 +3277,19 @@ class ServerImpl extends TcpDiscoveryImpl {
msg0 = new
TcpDiscoveryNodeAddedMessage(nodeAddedMsg);
prepareNodeAddedMessage(msg0,
clientMsgWorker.clientNodeId, null);
+
+ try {
+ msgBytes0 =
clientMsgSer.serializeMessage(msg0);
+ }
+ catch (IgniteCheckedException | IOException e) {
+ U.error(log, "Failed to serialize message: " +
msg0, e);
+
+ return;
+ }
}
}
- clientMsgWorker.addMessage(msg0, msgBytes);
+ clientMsgWorker.addMessage(msg0, msgBytes0);
}
}
}