Repository: ignite Updated Branches: refs/heads/master 3bb034442 -> f156631cd
IGNITE-9932 Ignoring exchanger critical section begin/end if called from illegal thread. - Fixes #5026. Signed-off-by: Alexey Goncharuk <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f156631c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f156631c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f156631c Branch: refs/heads/master Commit: f156631cdd4c1b69327f76df744b27d03f575b5c Parents: 3bb0344 Author: Andrey Kuznetsov <[email protected]> Authored: Mon Oct 22 10:33:09 2018 +0300 Committer: Alexey Goncharuk <[email protected]> Committed: Mon Oct 22 10:33:09 2018 +0300 ---------------------------------------------------------------------- .../cache/GridCachePartitionExchangeManager.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/f156631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java index 0b8dd75..8b8efa3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java @@ -2348,9 +2348,8 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * Should be called from exchange worker thread. */ public void exchangerBlockingSectionBegin() { - assert exchWorker != null && Thread.currentThread() == exchWorker.runner(); - - exchWorker.blockingSectionBegin(); + if (currentThreadIsExchanger()) + exchWorker.blockingSectionBegin(); } /** @@ -2358,9 +2357,13 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana * Should be called from exchange worker thread. */ public void exchangerBlockingSectionEnd() { - assert exchWorker != null && Thread.currentThread() == exchWorker.runner(); + if (currentThreadIsExchanger()) + exchWorker.blockingSectionEnd(); + } - exchWorker.blockingSectionEnd(); + /** */ + private boolean currentThreadIsExchanger() { + return exchWorker != null && Thread.currentThread() == exchWorker.runner(); } /**
