kfaraz commented on code in PR #17723:
URL: https://github.com/apache/druid/pull/17723#discussion_r1954311836


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:
##########
@@ -1887,10 +1887,12 @@ public Response pauseHTTP(
   @VisibleForTesting
   public Response pause() throws InterruptedException
   {
-    if (!(status == Status.PAUSED || status == Status.READING)) {
+    Status currentStatus = status;
+    if (!(currentStatus == Status.PAUSED || currentStatus == Status.READING)) {

Review Comment:
   I am not sure but it feels that this will only end up suppressing the real 
root cause here.
   
   The problem is that once we have entered this `if` block, the status 
actually changes to `PAUSED`.
   But why did that change happen? Either `pause()` had already been called or 
something else happened that caused the runner thread to pause the task.
   
   The `volatile` business is making things complicated. We should perhaps 
consider adding some locking around the `status` field.



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