suraj-goel commented on code in PR #17723:
URL: https://github.com/apache/druid/pull/17723#discussion_r1954828223


##########
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:
   The root cause lies in 
[possiblyPause](https://github.com/apache/druid/blob/e200eee1012e7f222afe9809993588e97872a1bb/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java#L1372)
 method.
   In this method `status` field is synchronized using `pauseLock`.
   
   The same lock is used in `pause` method as well but after the `if` 
condition. 
   I can move the pauseLock before the `if` statement so that status field 
remains atomic between these 2 methods.
   
   Let me know your thoughts. I can test it in a Druid cluster if this sounds 
good to you.



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