You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/09/08 14:46:05 UTC
[23/50] ignite git commit: Fix LockId logic
Fix LockId logic
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b88ef7cb
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b88ef7cb
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b88ef7cb
Branch: refs/heads/ignite-3199-1
Commit: b88ef7cb425c38c8bfb3de3f35afea681e7dbe41
Parents: 78d184d
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Mon Sep 5 19:58:20 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Mon Sep 5 19:58:20 2016 +0300
----------------------------------------------------------------------
.../IgniteSessionStateStoreProvider.cs | 2 ++
.../AspNet/IgniteSessionStateStoreProviderTest.cs | 14 +++++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/b88ef7cb/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs
index 5c13c29..2aa4e70 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/IgniteSessionStateStoreProvider.cs
@@ -183,6 +183,8 @@ namespace Apache.Ignite.AspNet
lockAge = DateTime.UtcNow - data.LockTime.Value;
+ lockId = data.LockId;
+
return null;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/b88ef7cb/modules/platforms/dotnet/Apache.Ignite.Core.Tests/AspNet/IgniteSessionStateStoreProviderTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/AspNet/IgniteSessionStateStoreProviderTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/AspNet/IgniteSessionStateStoreProviderTest.cs
index 97ec63e..0cedc0e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/AspNet/IgniteSessionStateStoreProviderTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/AspNet/IgniteSessionStateStoreProviderTest.cs
@@ -215,7 +215,19 @@ namespace Apache.Ignite.Core.Tests.AspNet
object lockId1; // do not overwrite lockId
res = provider.GetItem(HttpContext, Id, out locked, out lockAge, out lockId1, out actions);
Assert.IsNull(res);
- Assert.IsNull(lockId1);
+ Assert.IsNotNull(lockId1);
+ Assert.IsTrue(locked);
+ Assert.Greater(lockAge, TimeSpan.Zero);
+ Assert.AreEqual(SessionStateActions.None, actions);
+ }).Wait();
+
+ // Try to get it in a different thread.
+ Task.Factory.StartNew(() =>
+ {
+ object lockId1; // do not overwrite lockId
+ res = provider.GetItemExclusive(HttpContext, Id, out locked, out lockAge, out lockId1, out actions);
+ Assert.IsNull(res);
+ Assert.IsNotNull(lockId1);
Assert.IsTrue(locked);
Assert.Greater(lockAge, TimeSpan.Zero);
Assert.AreEqual(SessionStateActions.None, actions);