This is an automated email from the ASF dual-hosted git repository. amashenkov pushed a commit to branch gg-19225 in repository https://gitbox.apache.org/repos/asf/ignite.git
commit 5b47baa78b351cd8f7f09cc16fad8804ece69d14 Author: EdShangGG <[email protected]> AuthorDate: Tue Dec 11 18:37:45 2018 +0300 IGNITE-10623 More graceful error handling when node is stopping - Fixes #5623. Signed-off-by: Alexey Goncharuk <[email protected]> (cherry picked from commit d7111f3eec448009a6d3c9ff3731ac2e121660f2) --- .../processors/cache/GridCacheMvccManager.java | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java index e023a42..52b1d90 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java @@ -426,11 +426,26 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter { * @param err Error. */ private void cancelClientFutures(IgniteCheckedException err) { - for (GridCacheFuture<?> fut : activeFutures()) - ((GridFutureAdapter)fut).onDone(err); + cancelFuturesWithException(err, activeFutures()); + cancelFuturesWithException(err, atomicFuts.values()); + } - for (GridCacheAtomicFuture<?> future : atomicFuts.values()) - ((GridFutureAdapter)future).onDone(err); + /** + * @param err Error to complete future with. + * @param futures Collection of futures. + */ + private void cancelFuturesWithException( + IgniteCheckedException err, + Collection<? extends IgniteInternalFuture<?>> futures + ) { + for (IgniteInternalFuture<?> fut : futures) { + try { + ((GridFutureAdapter)fut).onDone(err); + } + catch (Exception e) { + U.warn(log, "Failed to complete future on node stop (will ignore): " + fut, e); + } + } } /**
