From d3e9506a1d9ec74ed7a7e29a58c045cec081881b Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Sun, 8 Jul 2012 12:06:57 +0200 Subject: [PATCH] ad more info when rejecting execution --- .../elasticsearch/common/util/concurrent/EsAbortPolicy.java | 2 +- .../common/util/concurrent/EsRejectedExecutionException.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/common/util/concurrent/EsAbortPolicy.java b/src/main/java/org/elasticsearch/common/util/concurrent/EsAbortPolicy.java index 3e2ea780783..9b25ffdf50e 100644 --- a/src/main/java/org/elasticsearch/common/util/concurrent/EsAbortPolicy.java +++ b/src/main/java/org/elasticsearch/common/util/concurrent/EsAbortPolicy.java @@ -30,6 +30,6 @@ public class EsAbortPolicy implements RejectedExecutionHandler { @Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { - throw new EsRejectedExecutionException(); + throw new EsRejectedExecutionException("rejected execution of [" + r.getClass().getName() + "]"); } } diff --git a/src/main/java/org/elasticsearch/common/util/concurrent/EsRejectedExecutionException.java b/src/main/java/org/elasticsearch/common/util/concurrent/EsRejectedExecutionException.java index e9c7c452791..050c9fecd56 100644 --- a/src/main/java/org/elasticsearch/common/util/concurrent/EsRejectedExecutionException.java +++ b/src/main/java/org/elasticsearch/common/util/concurrent/EsRejectedExecutionException.java @@ -26,6 +26,10 @@ import org.elasticsearch.rest.RestStatus; */ public class EsRejectedExecutionException extends ElasticSearchException { + public EsRejectedExecutionException(String message) { + super(message); + } + public EsRejectedExecutionException() { super(null); }