gianm commented on code in PR #17828:
URL: https://github.com/apache/druid/pull/17828#discussion_r2017697295


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java:
##########
@@ -127,7 +123,13 @@ public class TaskQueue
   private final ObjectMapper passwordRedactingMapper;
   private final TaskContextEnricher taskContextEnricher;
 
-  private final ReentrantLock giant = new ReentrantLock(true);
+  /**
+   * Lock used to ensure that {@link #start} and {@link #stop} do not run while
+   * queue management is in progress. {@link #start} and {@link #stop} methods
+   * acquire a WRITE lock whereas all other operations acquire a READ lock.
+   */
+  private final ReentrantReadWriteLock giant = new 
ReentrantReadWriteLock(true);

Review Comment:
   Consider renaming to `startStopLock`, since its main purpose now is to 
synchronize `start` and `stop` with each other and with the other operations.



-- 
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: commits-unsubscr...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to