andresbeckruiz commented on code in PR #360:
URL: https://github.com/apache/cassandra-sidecar/pull/360#discussion_r3555015640


##########
server/src/main/java/org/apache/cassandra/sidecar/job/OperationalJobManager.java:
##########
@@ -99,19 +107,60 @@ public void trySubmitJob(OperationalJob job,
         try
         {
             checkConflict(job);
-
-            // New job is submitted for all cases when we do not have a 
corresponding downstream job
-            jobTracker.computeIfAbsent(job.jobId(), jobId -> {
-                internalExecutorPool.executeBlocking(job::execute);
-                return job;
-            });
         }
         catch (OperationalJobConflictException oje)
         {
             onComplete.accept(job, oje);
             return;
         }
 
+        if (!job.requiresCoordination())
+        {
+            trackAndExecute(job, onComplete, serviceExecutorPool, waitTime);
+            return;
+        }
+
+        // Acquiring the active operation lock might perform blocking storage 
I/O so it must
+        // run off the event loop
+        acquireActiveOperationLock(job)
+        .onComplete(ar ->
+        {
+            if (ar.succeeded() && Boolean.TRUE.equals(ar.result()))
+            {
+                job.asyncResult().onComplete(result -> 
releaseActiveOperationLock(job));

Review Comment:
   Good catch-- addressed in 
[1bd9057](https://github.com/apache/cassandra-sidecar/pull/360/commits/1bd9057dbcf307c3c81d3fae046ec5f5b0ba39f1)



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