gianm commented on code in PR #13072:
URL: https://github.com/apache/druid/pull/13072#discussion_r969027097
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -1454,20 +1454,23 @@ public void runInternal()
checkCurrentTaskState();
- synchronized (stateChangeLock) {
- // if supervisor is not suspended, ensure required tasks are running
- // if suspended, ensure tasks have been requested to gracefully stop
- if
(stateManager.getSupervisorState().getBasicState().equals(SupervisorStateManager.BasicState.STOPPING))
{
- // if we're already terminating, don't do anything here, the
terminate already handles shutdown
- log.info("[%s] supervisor is already stopping.", dataSource);
- } else if (!spec.isSuspended()) {
- log.info("[%s] supervisor is running.", dataSource);
-
-
stateManager.maybeSetState(SeekableStreamSupervisorStateManager.SeekableStreamState.CREATING_TASKS);
- createNewTasks();
- } else {
- log.info("[%s] supervisor is suspended.", dataSource);
- gracefulShutdownInternal();
+ // If supervisor is already stopping, don't contend for stateChangeLock
since the block can be skipped
+ if
(!stateManager.getSupervisorState().getBasicState().equals(SupervisorStateManager.BasicState.STOPPING))
{
Review Comment:
Is there a race here? Could the state be set to STOPPING between this check
and the entry into `synchronized (stateChangeLock)`?
--
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]