tkalkirill commented on a change in pull request #483:
URL: https://github.com/apache/ignite-3/pull/483#discussion_r761051089



##########
File path: 
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
##########
@@ -785,26 +785,32 @@ public void remove(@NotNull Throwable e) {
                     }
             );
         }).exceptionally(t -> {
-            Throwable cause = t.getCause();
+            Throwable ex;
 
-            if (cause instanceof ConfigurationChangeException) {
-                cause = cause.getCause();
-            }
+            if (t instanceof CompletionException) {
+                if (t.getCause() instanceof ConfigurationChangeException) {
+                    ex = t.getCause().getCause();
+                } else {
+                    ex = t.getCause();
+                }
 
-            if (cause instanceof TableAlreadyExistsException) {
-                TableAlreadyExistsException tableAlreadyExistsException = 
(TableAlreadyExistsException) cause;
+                assert ex != null;
+            } else {
+                ex = t;
+            }
 
+            if (ex instanceof TableAlreadyExistsException) {
                 tableAsync(name, false).thenAccept(table -> {
                     if (!exceptionWhenExist) {
                         tblFut.complete(table);
                     }
 
-                    removeListener(TableEvent.CREATE, clo, new 
IgniteInternalCheckedException(tableAlreadyExistsException));
+                    removeListener(TableEvent.CREATE, clo, new 
IgniteInternalCheckedException(ex));

Review comment:
       Because we have checked `ex instanceof TableAlreadyExistsException`, 
variable is not needed.




-- 
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]


Reply via email to