Class UnsafePlainActionFuture<T>

java.lang.Object
org.elasticsearch.action.support.PlainActionFuture<T>
org.elasticsearch.action.support.UnsafePlainActionFuture<T>
All Implemented Interfaces:
Future<T>, ActionFuture<T>, ActionListener<T>

@Deprecated(forRemoval=true) public class UnsafePlainActionFuture<T> extends PlainActionFuture<T>
Deprecated, for removal: This API element is subject to removal in a future version.
An unsafe future. You should not need to use this for new code, rather you should be able to convert that code to be async or use a clear hierarchy of thread pool executors around the future.

This future is unsafe, since it allows notifying the future on the same thread pool executor that it is being waited on. This is a common deadlock scenario, since all threads may be waiting and thus no thread may be able to complete the future.

Note that the deadlock protection in PlainActionFuture is very weak. In general there's a risk of deadlock if there's any cycle of threads which block/complete on each other's futures, or dispatch work to each other, but this is much harder to detect.

  • Constructor Details

    • UnsafePlainActionFuture

      public UnsafePlainActionFuture(String... unsafeExecutors)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a future which permits any of the given named executors to be used unsafely (i.e. used for both waiting for the future's completion and completing the future).