@@ -92,7 +92,10 @@ public class OptOutSqsLogProducer extends AbstractVerticle {
9292 private final TrafficCalculator trafficCalculator ;
9393 private final DeltaProductionOrchestrator orchestrator ;
9494
95- // tracks the current delta production job status for this pod
95+ /*
96+ * Tracks the current delta production job status for this pod.
97+ * Used to prevent concurrent jobs from running.
98+ */
9699 private final AtomicReference <DeltaProductionJobStatus > currentJob = new AtomicReference <>(null );
97100
98101 private volatile boolean shutdownInProgress = false ;
@@ -270,7 +273,7 @@ private void handleDeltaProduceStart(RoutingContext routingContext) {
270273
271274 DeltaProductionJobStatus existingJob = currentJob .get ();
272275
273- // If there's an existing job, check if it's still running
276+ // if there's an existing job, check if it's still running
274277 if (existingJob != null ) {
275278 if (existingJob .getState () == DeltaProductionJobStatus .JobState .RUNNING ) {
276279 LOGGER .info ("job already running, returning conflict" );
@@ -283,7 +286,7 @@ private void handleDeltaProduceStart(RoutingContext routingContext) {
283286
284287 DeltaProductionJobStatus newJob = new DeltaProductionJobStatus ();
285288
286- // Try to set the new job
289+ // try to set the new job
287290 if (!currentJob .compareAndSet (existingJob , newJob )) {
288291 sendConflict (resp , "job state changed, please retry" );
289292 return ;
@@ -292,7 +295,7 @@ private void handleDeltaProduceStart(RoutingContext routingContext) {
292295 LOGGER .info ("starting new job" );
293296 this .startDeltaProductionJob (newJob );
294297
295- // Return immediately with 202 Accepted
298+ // return immediately with 202 Accepted
296299 sendAccepted (resp , "job started" );
297300 }
298301
0 commit comments