valepakh commented on code in PR #7474:
URL: https://github.com/apache/ignite-3/pull/7474#discussion_r2744989013


##########
modules/rest/src/main/java/org/apache/ignite/internal/rest/deployment/CompletedFileUploadSubscriber.java:
##########
@@ -76,18 +76,19 @@ public void onComplete() {
         if (ex != null) {
             result.completeExceptionally(ex);
         } else {
-            try {
-                DeploymentUnit deploymentUnit = collector.toDeploymentUnit();
-                result.complete(deploymentUnit);
-            } catch (Exception e) {
-                suppressException(e);
-                try {
-                    collector.rollback();
-                } catch (Exception e2) {
-                    suppressException(e2);
+            collector.toDeploymentUnit().whenComplete((deploymentUnit, 
throwable) -> {
+                if (throwable != null) {
+                    suppressException(throwable);
+                    try {
+                        collector.rollback();
+                    } catch (Exception e2) {
+                        suppressException(e2);
+                    }
+                    result.completeExceptionally(ex);

Review Comment:
   We need to complete the future with the `ex`, which could already be 
non-null. We add `throwable` to the suppressed exceptions in this case.



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