summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketselector/BucketSelectorPipelineAggregationBuilder.java
diff options
context:
space:
mode:
authorjaymode <jay.modi@elasticsearch.com>2016-04-05 09:01:47 -0400
committerjaymode <jay.modi@elasticsearch.com>2016-07-19 12:47:47 -0400
commit11389638f9393e854bd99513964a8c01f4c8db07 (patch)
tree68a08c163f0c90bd049933b9f908f62a004c1ca5 /core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketselector/BucketSelectorPipelineAggregationBuilder.java
parent0854b03f1351162fa205a7417b28c244ff5023e5 (diff)
Require executor name when calling scheduleWithFixedDelay
The ThreadPool#scheduleWithFixedDelay method does not make it clear that all scheduled runnable instances will be run on the scheduler thread. This becomes problematic if the actions being performed include blocking operations since there is a single thread and tasks may not get executed due to a blocking task. This change includes a few different aspects around trying to prevent this situation. The first is that the scheduleWithFixedDelay method now requires the name of the executor that should be used to execute the runnable. All existing calls were updated to use Names.SAME to preserve the existing behavior. The second aspect is the removal of using ScheduledThreadPoolExecutor#scheduleWithFixedDelay in favor of a custom runnable, ReschedulingRunnable. This runnable encapsulates the logic to deal with rescheduling a runnable with a fixed delay and mimics the behavior of executing using a ScheduledThreadPoolExecutor and provides a ScheduledFuture implementation that also mimics that of the typed returned by a ScheduledThreadPoolExecutor. Finally, an assertion was added to BaseFuture to detect blocking calls that are being made on the scheduler thread.
Diffstat (limited to 'core/src/main/java/org/elasticsearch/search/aggregations/pipeline/bucketselector/BucketSelectorPipelineAggregationBuilder.java')
0 files changed, 0 insertions, 0 deletions