xtern commented on code in PR #6932:
URL: https://github.com/apache/ignite-3/pull/6932#discussion_r2512949371


##########
modules/client/src/main/java/org/apache/ignite/internal/client/sql/PartitionMappingProvider.java:
##########
@@ -57,11 +59,23 @@ static PartitionMappingProvider create(
                 meta.indexes(),
                 meta.hash(),
                 meta.directTxMode(),
-                () -> schemaFuture.getNow(null),
-                () -> table.getPartitionAssignment().getNow(null)
+                () -> nullOnError(schemaFuture, onErrorCallback).getNow(null),
+                () -> nullOnError(table.getPartitionAssignment(), 
onErrorCallback).getNow(null)
         );
     }
 
+    private static <T> CompletableFuture<@Nullable T> 
nullOnError(CompletableFuture<T> future, Consumer<Throwable> onErrorCallback) {
+        return future.handle((result, throwable) -> {
+            if (throwable != null) {
+                onErrorCallback.accept(throwable);
+
+                return null;
+            }
+
+            return result;
+        });

Review Comment:
   ```suggestion
           return future.exceptionally(throwable -> {
               onErrorCallback.accept(throwable);
   
               return null;
           });
   ```



##########
modules/client/src/main/java/org/apache/ignite/internal/client/sql/ClientSql.java:
##########
@@ -365,10 +366,18 @@ private <T> PayloadReader<AsyncResultSet<T>> 
payloadReader(
 
                 assert table != null;
 
+                PaCacheKey key = new PaCacheKey(statement);
                 mappingProviderCache.put(
-                        new PaCacheKey(statement),
+                        key,
                         PartitionMappingProvider.create(
-                                table, partitionAwarenessMetadata
+                                table,
+                                partitionAwarenessMetadata,
+                                th -> {
+                                    if (th instanceof TableNotFoundException) {

Review Comment:
   Maybe it's worth logging other exceptions?



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