ptupitsyn commented on code in PR #1766:
URL: https://github.com/apache/ignite-3/pull/1766#discussion_r1136725937


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/sql/ClientSqlExecuteRequest.java:
##########
@@ -76,23 +81,29 @@ public static CompletableFuture<Void> process(
 
         return session
                 .executeAsync(tx, statement, arguments)
-                .thenCompose(asyncResultSet -> writeResultSetAsync(out, 
resources, asyncResultSet, session));
+                .thenCompose(asyncResultSet -> writeResultSetAsync(out, 
resources, asyncResultSet, session, metrics));
     }
 
     private static CompletionStage<Void> writeResultSetAsync(
             ClientMessagePacker out,
             ClientResourceRegistry resources,
             AsyncResultSet asyncResultSet,
-            Session session) {
+            Session session,
+            ClientHandlerMetricSource metrics) {
         boolean hasResource = asyncResultSet.hasRowSet() && 
asyncResultSet.hasMorePages();
 
         if (hasResource) {
             try {
-                var clientResultSet = new ClientSqlResultSet(asyncResultSet, 
session);
+                metrics.cursorsActiveIncrement();
+
+                var clientResultSet = new ClientSqlResultSet(asyncResultSet, 
session, metrics);
 
                 ClientResource resource = new ClientResource(
                         clientResultSet,
-                        () -> clientResultSet.closeAsync().join());
+                        () -> {
+                            clientResultSet.closeAsync();
+                            metrics.cursorsActiveDecrement();

Review Comment:
   Good catch, fixed. This is a leftover from initial implementation.



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