timoninmaxim commented on code in PR #12300:
URL: https://github.com/apache/ignite/pull/12300#discussion_r2308140121


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/SchemaOperationException.java:
##########
@@ -64,7 +64,7 @@ public class SchemaOperationException extends 
IgniteCheckedException {
     public static final int CODE_SCHEMA_NOT_FOUND = 11;
 
     /** Error code. */
-    private final int code;
+    private int code;

Review Comment:
   `code` must be final.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java:
##########
@@ -3982,58 +3980,27 @@ private void unwindPendingMessages(UUID opId, 
SchemaOperationManager mgr) {
             SchemaOperationStatusMessage msg = it.next();
 
             if (Objects.equals(msg.operationId(), opId)) {
-                mgr.onNodeFinished(msg.senderNodeId(), 
unmarshalSchemaError(msg.errorBytes()), msg.nop());
+                mgr.onNodeFinished(msg.senderNodeId(), schemaError(msg), 
msg.nop());
 
                 it.remove();
             }
         }
     }
 
     /**
-     * Marshal schema error.
-     *
-     * @param err Error.
-     * @return Error bytes.
+     * @param msg Status message.
+     * @return SchemaOperationException or null.
      */
-    @Nullable private byte[] marshalSchemaError(UUID opId, @Nullable 
SchemaOperationException err) {
-        if (err == null)
+    @Nullable private SchemaOperationException 
schemaError(SchemaOperationStatusMessage msg) {
+        if (msg.errorMessage() == null)
             return null;
 
-        try {
-            return U.marshal(marsh, err);
-        }
-        catch (Exception e) {
-            U.warn(log, "Failed to marshal schema operation error [opId=" + 
opId + ", err=" + err + ']', e);
+        SchemaOperationException e = new 
SchemaOperationException(msg.errorMessage());
 
-            try {
-                return U.marshal(marsh, new 
SchemaOperationException("Operation failed, but error cannot be " +
-                    "serialized (see local node log for more details) [opId=" 
+ opId + ", nodeId=" +
-                    ctx.localNodeId() + ']'));
-            }
-            catch (Exception e0) {
-                assert false; // Impossible situation.
+        if (msg.errorCode() != SchemaOperationException.CODE_GENERIC)

Review Comment:
   What is a purpose of this condition?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to