ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [1/7] ignite git commit: ignite-2797 Incorrect timeout calculation for optimistic transactions fixed
Date Tue, 22 Mar 2016 17:36:43 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2801 863a6c557 -> 5e772b02a


ignite-2797 Incorrect timeout calculation for optimistic transactions fixed


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5be5fa08
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5be5fa08
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5be5fa08

Branch: refs/heads/ignite-2801
Commit: 5be5fa080c7160184c9fbfa9b8b9b748f80c3078
Parents: fa356e3
Author: agura <agura@gridgain.com>
Authored: Thu Mar 17 15:18:44 2016 +0300
Committer: agura <agura@gridgain.com>
Committed: Mon Mar 21 17:36:42 2016 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/transactions/IgniteTxManager.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5be5fa08/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 2c1205a..e96a472 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -1394,12 +1394,12 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter
{
         throws IgniteCheckedException {
         assert tx.optimistic() || !tx.local();
 
-        long remainingTime = U.currentTimeMillis() - (tx.startTime() + tx.timeout());
+        long remainingTime = tx.timeout() - (U.currentTimeMillis() - tx.startTime());
 
         // For serializable transactions, failure to acquire lock means
         // that there is a serializable conflict. For all other isolation levels,
         // we wait for the lock.
-        long timeout = tx.timeout() == 0 ? 0 : remainingTime;
+        long timeout = tx.timeout() == 0 ? 0 : (remainingTime < 0 ? 0 : remainingTime);
 
         GridCacheVersion serOrder = (tx.serializable() && tx.optimistic()) ? tx.nearXidVersion()
: null;
 


Mime
View raw message