You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "rpuch (via GitHub)" <gi...@apache.org> on 2023/06/26 07:46:03 UTC

[GitHub] [ignite-3] rpuch commented on a diff in pull request #2248: IGNITE-19626 .NET: Propagate compute deployment units

rpuch commented on code in PR #2248:
URL: https://github.com/apache/ignite-3/pull/2248#discussion_r1241761767


##########
modules/compute/src/main/java/org/apache/ignite/internal/compute/ComputeComponentImpl.java:
##########
@@ -238,12 +238,15 @@ private void processExecuteRequest(ExecuteRequest executeRequest, String senderC
             List<DeploymentUnit> units = toDeploymentUnit(executeRequest.deploymentUnits());
 
             mapClassLoaderExceptions(jobClassLoader(units), executeRequest.jobClassName())
-                    .thenCompose(context -> {
-                        return doExecuteLocally(jobClass(context.classLoader(), executeRequest.jobClassName()), executeRequest.args())
-                                        .whenComplete((r, e) -> context.close())
-                                        .handle((result, ex) -> sendExecuteResponse(result, ex, senderConsistentId, correlationId));
-                            }
-                    );
+                    .whenComplete((context, err) -> {
+                        if (err != null) {
+                            sendExecuteResponse(null, err, senderConsistentId, correlationId);
+                        }
+
+                        doExecuteLocally(jobClass(context.classLoader(), executeRequest.jobClassName()), executeRequest.args())
+                                .whenComplete((r, e) -> context.close())

Review Comment:
   After this change, it seems that there is a possibility that the `context` will not be closed (if first `sendExecuteResponse` on line 243 throws an exception). How about moving the context closure after `whenComplete()`?



-- 
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-unsubscribe@ignite.apache.org

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