cryptoe commented on code in PR #17723:
URL: https://github.com/apache/druid/pull/17723#discussion_r1957245097
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:
##########
@@ -1887,10 +1887,13 @@ public Response pauseHTTP(
@VisibleForTesting
public Response pause() throws InterruptedException
{
- if (!(status == Status.PAUSED || status == Status.READING)) {
+ // Read the volatile status into a variable so that its value does not
change while the condition is evaluated
+ final Status currentStatus = status;
+ if (!(currentStatus == Status.PAUSED || currentStatus == Status.READING)) {
Review Comment:
TBH: 1890 does not add a lot of value :).
I think the valid state transitions should reside int the status class. That
way we have one central way of controlling the transitions instead of having
the logic spread all over the place.
Can be a follow up PR as well .
--
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]