From 5dfe02ec647c252711b72f1239d7a941b32c3bf4 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 18 Mar 2015 16:40:22 -0700 Subject: [PATCH] Core: Make sure that the queue size is set on the alert thread pools Also removed hack leftover. Original commit: elastic/x-pack-elasticsearch@44fd070f5d8fd15f0c754cd2ceb2ea5c2d45b2f4 --- .../elasticsearch/alerts/AlertsPlugin.java | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/elasticsearch/alerts/AlertsPlugin.java b/src/main/java/org/elasticsearch/alerts/AlertsPlugin.java index 6770a5c46f4..8ec65fa7e7a 100644 --- a/src/main/java/org/elasticsearch/alerts/AlertsPlugin.java +++ b/src/main/java/org/elasticsearch/alerts/AlertsPlugin.java @@ -58,25 +58,11 @@ public class AlertsPlugin extends AbstractPlugin { return settingsBuilder() .put("threadpool." + SCHEDULER_THREAD_POOL_NAME + ".type", "fixed") .put("threadpool." + SCHEDULER_THREAD_POOL_NAME + ".size", availableProcessors * 2) - .put(alertThreadPoolSettings(availableProcessors, null)) + .put("threadpool." + SCHEDULER_THREAD_POOL_NAME + ".queue_size", 1000) + .put("threadpool." + NAME + ".type", "fixed") + .put("threadpool." + NAME + ".size", availableProcessors * 5) + .put("threadpool." + NAME + ".queue_size", 1000) .build(); } - public static Settings alertThreadPoolSettings(int availableProcessors, Integer queueSize) { - // Executing an alert involves a lot of wait time for networking (search, several index requests + optional condition logic) - //TODO Hack to get around threadpool issue - if (queueSize != null) { - return settingsBuilder() - .put("threadpool." + NAME + ".type", "fixed") - .put("threadpool." + NAME + ".size", availableProcessors * 5) - .put("threadpool." + NAME + ".queue_size", queueSize) - .build(); - } else { - return settingsBuilder() - .put("threadpool." + NAME + ".type", "fixed") - .put("threadpool." + NAME + ".size", availableProcessors * 5) - .build(); - } - } - }