/** {@inheritDoc} */ @Override public void onTimeout() { if (log.isDebugEnabled()) log.debug("Timed out waiting for lock response: " + this); synchronized (GridDhtLockFuture.this) { timedOut = true; // Stop locks and responses processing. pendingLocks.clear(); clear(); } boolean releaseLocks = !(inTx() && cctx.tm().deadlockDetectionEnabled()); onComplete(false, false, releaseLocks); }
/** {@inheritDoc} */ @Override public boolean onDone(Boolean success, Throwable err) { if (log.isDebugEnabled()) log.debug("Received onDone(..) callback [success=" + success + ", err=" + err + ", fut=" + this + ']'); // Local GridDhtLockFuture if (inTx() && this.err instanceof IgniteTxTimeoutCheckedException && cctx.tm().deadlockDetectionEnabled()) return false; if (isDone()) return false; if (err != null) onError(err); if (err != null) success = false; return onComplete(success, true); }
/** {@inheritDoc} */ @Override public boolean onDone(Boolean success, Throwable err) { if (log.isDebugEnabled()) log.debug("Received onDone(..) callback [success=" + success + ", err=" + err + ", fut=" + this + ']'); if (inTx() && cctx.tm().deadlockDetectionEnabled() && (this.err instanceof IgniteTxTimeoutCheckedException || timedOut)) return false; // If locks were not acquired yet, delay completion. if (isDone() || (err == null && success && !checkLocks())) return false; if (err != null && !(err instanceof GridCacheLockTimeoutException)) onError(err); if (err != null) success = false; return onComplete(success, true); }
if (cctx.tm().deadlockDetectionEnabled()) { synchronized (GridNearLockFuture.this) { requestedKeys = requestedKeys0();
if (cctx.tm().deadlockDetectionEnabled()) { synchronized (GridDhtColocatedLockFuture.this) { requestedKeys = requestedKeys0();
if (cctx.tm().deadlockDetectionEnabled()) { Set<IgniteTxKey> keys = null;
/** * @throws Exception If failed. */ @Test public void testNoHangsPessimistic() throws Exception { assertTrue(grid(0).context().cache().context().tm().deadlockDetectionEnabled()); doTest(PESSIMISTIC); try { GridTestUtils.setFieldValue(null, IgniteTxManager.class, "DEADLOCK_MAX_ITERS", 0); assertFalse(grid(0).context().cache().context().tm().deadlockDetectionEnabled()); doTest(PESSIMISTIC); } finally { GridTestUtils.setFieldValue(null, IgniteTxManager.class, "DEADLOCK_MAX_ITERS", IgniteSystemProperties.getInteger(IGNITE_TX_DEADLOCK_DETECTION_MAX_ITERS, 1000)); } }
/** * @throws Exception If failed. */ @Test public void testNoHangsOptimistic() throws Exception { assertTrue(grid(0).context().cache().context().tm().deadlockDetectionEnabled()); doTest(OPTIMISTIC); try { GridTestUtils.setFieldValue(null, IgniteTxManager.class, "DEADLOCK_MAX_ITERS", 0); assertFalse(grid(0).context().cache().context().tm().deadlockDetectionEnabled()); doTest(OPTIMISTIC); } finally { GridTestUtils.setFieldValue(null, IgniteTxManager.class, "DEADLOCK_MAX_ITERS", IgniteSystemProperties.getInteger(IGNITE_TX_DEADLOCK_DETECTION_MAX_ITERS, 1000)); } }
cctx.tm().deadlockDetectionEnabled()) return;
if (inTx() && cctx.tm().deadlockDetectionEnabled() && (res.error() instanceof IgniteTxTimeoutCheckedException || tx.remainingTime() == -1)) return;
/** {@inheritDoc} */ @SuppressWarnings({"ThrowableInstanceNeverThrown"}) @Override public void onTimeout() { if (log.isDebugEnabled()) log.debug("Timed out waiting for lock response: " + this); synchronized (GridDhtLockFuture.this) { timedOut = true; // Stop locks and responses processing. pendingLocks.clear(); clear(); } boolean releaseLocks = !(inTx() && cctx.tm().deadlockDetectionEnabled()); onComplete(false, false, releaseLocks); }
/** {@inheritDoc} */ @Override public boolean onDone(Boolean success, Throwable err) { if (log.isDebugEnabled()) log.debug("Received onDone(..) callback [success=" + success + ", err=" + err + ", fut=" + this + ']'); // Local GridDhtLockFuture if (inTx() && this.err instanceof IgniteTxTimeoutCheckedException && cctx.tm().deadlockDetectionEnabled()) return false; if (isDone()) return false; if (err != null) onError(err); if (err != null) success = false; return onComplete(success, true); }
/** {@inheritDoc} */ @Override public boolean onDone(Boolean success, Throwable err) { if (log.isDebugEnabled()) log.debug("Received onDone(..) callback [success=" + success + ", err=" + err + ", fut=" + this + ']'); if (inTx() && cctx.tm().deadlockDetectionEnabled() && (this.err instanceof IgniteTxTimeoutCheckedException || timedOut)) return false; // If locks were not acquired yet, delay completion. if (isDone() || (err == null && success && !checkLocks())) return false; if (err != null && !(err instanceof GridCacheLockTimeoutException)) onError(err); if (err != null) success = false; return onComplete(success, true); }
if (cctx.tm().deadlockDetectionEnabled()) { synchronized (GridDhtColocatedLockFuture.this) { requestedKeys = requestedKeys0();
if (cctx.tm().deadlockDetectionEnabled()) { synchronized (GridNearLockFuture.this) { requestedKeys = requestedKeys0();
if (cctx.tm().deadlockDetectionEnabled()) { Set<IgniteTxKey> keys = null;
cctx.tm().deadlockDetectionEnabled()) return;
if (inTx() && cctx.tm().deadlockDetectionEnabled() && (res.error() instanceof IgniteTxTimeoutCheckedException || tx.remainingTime() == -1)) return;