IGNITE-1678 minor assert added + fix NPE
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cf9a98f9 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cf9a98f9 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cf9a98f9 Branch: refs/heads/ignite-1678 Commit: cf9a98f938f740c226b71ad73e734ac1834d97fe Parents: 2d26270 Author: Dmitriy Govorukhin <dmitriy.govoruk...@gmail.com> Authored: Mon Aug 27 13:44:39 2018 +0300 Committer: Dmitriy Govorukhin <dmitriy.govoruk...@gmail.com> Committed: Mon Aug 27 13:44:39 2018 +0300 ---------------------------------------------------------------------- .../datastructures/GridCacheAtomicSequenceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/cf9a98f9/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java index 295feea..ba75bfa 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java @@ -251,17 +251,19 @@ public final class GridCacheAtomicSequenceImpl extends AtomicDataStructureProxy< return updated ? locVal : curVal; } // Switched to the next interval. New value more that upper reserved bound. - else if (!reservationInProgress) { + else { + assert !reservationInProgress; + long diff = newLocalVal - reservedUpBound; // Calculate how many batch size included in l. // It will our offset for global seq counter. long off = (diff / batchSize) * batchSize; - reservationFut = runAsyncReservation(off); + reservationFut = reservation = runAsyncReservation(off); // Can not wait async, should wait under lock until new interval reserved. - reservationFut.get(); + reservation.get(); reservationFut = null; }