Merge pull request #15318 from bleskes/cancellable_thread

CancellableThreads should also treat ThreadInterruptedException as InterruptedException

RecoverySource uses the RateLimiter under a cancelable thread. The SimpleRateLimiter used in throws ThreadInterruptedException on interruption. We should treat it as InterruptedException
This commit is contained in:
Boaz Leskes 2015-12-09 09:29:47 +01:00
commit 20bff773ed
1 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@
*/ */
package org.elasticsearch.common.util; package org.elasticsearch.common.util;
import org.apache.lucene.util.ThreadInterruptedException;
import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Nullable;
@ -84,7 +85,7 @@ public class CancellableThreads {
RuntimeException throwable = null; RuntimeException throwable = null;
try { try {
interruptable.run(); interruptable.run();
} catch (InterruptedException e) { } catch (InterruptedException | ThreadInterruptedException e) {
// assume this is us and ignore // assume this is us and ignore
} catch (RuntimeException t) { } catch (RuntimeException t) {
throwable = t; throwable = t;