This is an automated email from the ASF dual-hosted git repository. samarth pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push: new 3619395 perf: eliminate expensive log construction in remote-task-runner shutdown (#12097) 3619395 is described below commit 36193955b6d8a03fe247157dddebea0365c7e501 Author: Jason Koch <jk...@netflix.com> AuthorDate: Thu Mar 3 13:38:21 2022 -0800 perf: eliminate expensive log construction in remote-task-runner shutdown (#12097) --- .../java/org/apache/druid/indexing/overlord/TaskQueue.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java index 01dec0d..07865e1 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java @@ -325,13 +325,17 @@ public class TaskQueue final Set<String> tasksToKill = Sets.difference(runnerTaskFutures.keySet(), knownTaskIds); if (!tasksToKill.isEmpty()) { log.info("Asking taskRunner to clean up %,d tasks.", tasksToKill.size()); + + // On large installations running several thousands of tasks, + // concatenating the list of known task ids can be compupationally expensive. + final boolean logKnownTaskIds = log.isDebugEnabled(); + final String reason = logKnownTaskIds + ? String.format("Task is not in knownTaskIds[%s]", knownTaskIds) + : "Task is not in knownTaskIds"; + for (final String taskId : tasksToKill) { try { - taskRunner.shutdown( - taskId, - "task is not in knownTaskIds[%s]", - knownTaskIds - ); + taskRunner.shutdown(taskId, reason); } catch (Exception e) { log.warn(e, "TaskRunner failed to clean up task: %s", taskId); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org