arjunashok commented on code in PR #144:
URL: https://github.com/apache/cassandra-sidecar/pull/144#discussion_r1911491394


##########
server/src/main/java/org/apache/cassandra/sidecar/job/OperationalJob.java:
##########
@@ -193,11 +199,41 @@ public void execute(Promise<Void> promise)
     {
         isExecuting = true;
         LOGGER.info("Executing job. jobId={}", jobId);
-        promise.future().onComplete(executionPromise);
+
+        promise.future().onComplete(res -> {
+            if (res.succeeded())
+            {
+                try
+                {
+                    OperationalJobStatus result = executeInternal();
+                    executionPromise.tryComplete(result);
+                    if (LOGGER.isDebugEnabled())
+                    {
+                        LOGGER.debug("Complete job execution. jobId={} 
status={}", jobId, status());
+                    }
+                }
+                catch (Throwable e)
+                {
+                    executionPromise.tryFail(e);
+                }
+            }
+            else
+            {
+                Throwable cause = res.cause();
+                executionPromise.tryFail(cause);
+            }
+        });
+
+
+
+
+
+
         try
         {
             // Blocking call to perform concrete job-specific execution, 
returning the status
-            executeInternal();
+            OperationalJobStatus result = executeInternal();
+            executionPromise.tryComplete(result);

Review Comment:
   Thi change goes away with the `Void` execution promise



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to