jtuglu1 commented on code in PR #19286:
URL: https://github.com/apache/druid/pull/19286#discussion_r3087906555
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/LagBasedAutoScaler.java:
##########
@@ -83,23 +82,24 @@ public LagBasedAutoScaler(
}
@Override
- public void start()
+ public int computeTaskCountForScaleAction()
{
- Callable<Integer> scaleAction = () -> {
- LOCK.lock();
- int desiredTaskCount = -1;
- try {
- desiredTaskCount = computeDesiredTaskCount(new
ArrayList<>(lagMetricsQueue));
- }
- catch (Exception ex) {
- log.warn(ex, "Exception while computing desired task count for
supervisor[%s]", spec.getId());
- }
- finally {
- LOCK.unlock();
- }
- return desiredTaskCount;
- };
+ LOCK.lock();
Review Comment:
I'm not planning to make any logical changes to the core lag auto-scaler
logic in this PR (it's big enough as-is). I think a follow-up can be done to
decide whether this lock is needed or not.
--
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]