This is an automated email from the ASF dual-hosted git repository.
shishkovilja pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new d45d2be3773 IGNITE-26757 Revert deletion of extra exception handling
during ErrorMessage marshaling (#12471)
d45d2be3773 is described below
commit d45d2be3773db8213ac8369ab311ce9e56799966
Author: Vladimir Steshin <[email protected]>
AuthorDate: Wed Oct 29 14:27:01 2025 +0300
IGNITE-26757 Revert deletion of extra exception handling during
ErrorMessage marshaling (#12471)
---
.../internal/managers/communication/ErrorMessage.java | 19 +++++++++++++++++--
.../processors/cache/CacheInvokeDirectResult.java | 2 +-
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java
index 36063c2352b..71b7955d48f 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java
@@ -36,6 +36,7 @@ import static org.apache.ignite.marshaller.Marshallers.jdk;
* <p>Because raw serialization of throwables is prohibited, you should use
this message when it is necessary
* to transfer some error as part of some message. See {@link
MessageProcessor} for details.
* <p>Currently, under the hood marshalling and unmarshalling is performed by
{@link JdkMarshaller}.
+ * <p>If the message serialization fails, wraps this error with own one.
*/
@SuppressWarnings({"NullableProblems", "unused"})
public class ErrorMessage implements Message {
@@ -74,8 +75,22 @@ public class ErrorMessage implements Message {
try {
return U.marshal(jdk(), err);
}
- catch (IgniteCheckedException e) {
- throw new IgniteException("Unable to marshal the holding error.",
e);
+ catch (IgniteCheckedException e0) {
+ IgniteCheckedException wrappedErr = new
IgniteCheckedException(err.getMessage());
+
+ wrappedErr.setStackTrace(err.getStackTrace());
+ wrappedErr.addSuppressed(e0);
+
+ try {
+ return U.marshal(jdk(), wrappedErr);
+ }
+ catch (IgniteCheckedException e1) {
+ IgniteException marshErr = new IgniteException("Unable to
marshal the wrapping error.", e1);
+
+ marshErr.addSuppressed(wrappedErr);
+
+ throw marshErr;
+ }
}
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
index e9e66c48ec9..1a13b532a96 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
@@ -87,7 +87,7 @@ public class CacheInvokeDirectResult implements Message {
*/
public CacheInvokeDirectResult(KeyCacheObject key, Throwable err) {
this.key = key;
- this.errMsg = new ErrorMessage(err);
+ errMsg = new ErrorMessage(err);
}
/**