Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Table of Contents

Motivation

Cache and Compute async operations invoke the future listeners on Ignite thread pools, such as Public pool and Striped pool threads:

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

...

Code Block
languagec#
await cache.PutAsync(1, 1);
// Now we are on a Striped pool!

// CPU-heavy method blocks the stripe and cache ops are stalled
RunSomething();


A similar problem exists for Compute. Async operation continuations are executed on the Public pool, which can lead to starvation there when all threads are taken up by continuation logic.

Description

  • 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

...