vldpyatkov commented on a change in pull request #488:
URL: https://github.com/apache/ignite-3/pull/488#discussion_r761978486
##########
File path:
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
##########
@@ -937,25 +874,49 @@ public void remove(@NotNull Throwable e) {
schemaCh.changeSchema(SchemaSerializerImpl.INSTANCE.serialize(descriptor));
}));
}
- )).exceptionally(t -> {
- LOG.error(LoggerMessageHelper.format("Table wasn't altered
[name={}]", name), t);
+ )).whenComplete((res, t) -> {
+ if (t != null) {
+ Throwable ex = getRootCause(t);
- Throwable cause = t.getCause();
+ assert ex != null;
- if (cause instanceof ConfigurationChangeException) {
- cause = cause.getCause();
- }
+ LOG.error(LoggerMessageHelper.format("Table wasn't
altered [name={}]", name), ex);
- removeListener(TableEvent.ALTER, clo, new
IgniteInternalCheckedException(cause));
-
- return null;
+ tblFut.completeExceptionally(ex);
+ } else {
+ tblFut.complete(res);
+ }
});
}
});
return tblFut;
}
+ /**
+ * Gets a cause exception for a client.
+ *
+ * @param t Exception wrapper.
+ * @return Root exception if the exception is wrapped on.
+ */
+ private Throwable getRootCause(Throwable t) {
+ Throwable ex;
+
+ if (t instanceof CompletionException) {
+ if (t.getCause() instanceof ConfigurationChangeException) {
+ //TODO: IGNITE-16051 Only public exception for configuration
validation should return here.
Review comment:
I can reformulate it, but still sure only public exception can be a
cause.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]