Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: add benchmark results

...

Cache async operations invoke future listeners on Striped pool threads:, which can cause deadlocks and/or reduce cache performance.

Code Block
languagejava
IgniteFuture fut = cache.putAsync(1, 1);
fut.listen(f -> {
    // Executes on Striped pool and deadlocks.
    cache.replace(1, 2);
});

...

  • Add IgniteConfiguration#asyncContinuationExecutor (of type Executor).
  • Use ForkJoinPool#commonPool by default (when null / not set).
  • Use this executor for all Cache and Compute async continuations

This automatically fixes the same issue in Java, .NET and C++ (thick), because thick integrations use direct JNI callbacks for Futures.

NOTE: This IEP is NOT related to scan query filters, cache entry processors, etc, which also run on Striped pool.

...

Those users can force the old behavior with `IgniteConfiguration.setAsyncContinuationExecutor(Runnable::run)`.

Performance

Executing continuation on a different thread involves some overhead. Local benchmark with integer key and value shows ~6% drop (see JmhCacheAsyncListenBenchmark in the PoC).

In a real world workload the difference should be insignificant.

Code Block

Discussion Links

languagejava
Benchmark                          Mode  Cnt      Score      Error  Units
JmhCacheAsyncListenBenchmark.put  thrpt   10  77859.584 ± 2071.196  ops/s (before)
JmhCacheAsyncListenBenchmark.put  thrpt   10  73393.986 ± 1336.420  ops/s (after)


Discussion Links

IEP thread: httphttp://apache-ignite-developers.2346864.n4.nabble.com/IEP-70-Async-Continuation-Executor-td51775.html

Original discussions: 


Reference Links

PoC: https://github.com/apache/ignite/pull/8870

...