-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PutIfAbsent with ForceReturnValue=true hangs indefinitely for non-existent keys #47
Comments
@rigazilla thanks for the fast response, it is fixed, but now the next request hangs Example codeusing Infinispan.Hotrod.Core;
using System;
var ispnCluster = new InfinispanDG
{
User = "admin",
Password = "admin",
AuthMech = "DIGEST-MD5",
Version = 0x1f,
ClientIntelligence = 0x03,
ForceReturnValue = true,
};
ispnCluster.AddHost("localhost", 11222);
System.Threading.Thread.Sleep(1000);
var cache = ispnCluster.NewCache(new StringMarshaller(), new StringMarshaller(), "test1");
string key = Guid.NewGuid().ToString();
string result = await cache.PutIfAbsent(key, "value1").WaitAsync(TimeSpan.FromSeconds(30));
Console.WriteLine("Result is: " + result);
string getResult = await cache.Get(key).WaitAsync(TimeSpan.FromSeconds(30));
Console.WriteLine("Get Result is: " + getResult); Expected Result
Actual Result
I am testing both distributed and replicated caches, both transactional. |
@ppetrovt, unfortunately C# client doesn't support transactions yet. |
@rigazilla I have tried many configurations; here are some of them. {
"ProfileData": {
"replicated-cache": {
"mode": "ASYNC",
"statistics": true,
"encoding": {
"media-type": "application/json"
}
}
}
} {
"ProfileDataTransactional": {
"replicated-cache": {
"mode": "SYNC",
"statistics": true,
"encoding": {
"media-type": "application/json"
},
"locking": {
"isolation": "REPEATABLE_READ"
},
"transaction": {
"mode": "NON_XA",
"locking": "OPTIMISTIC"
}
}
}
}
|
When utilizing the
PutIfAbsent
method with the parameterForceReturnValue
set totrue
, an unexpected behavior occurs when the key doesn't exist. Specifically, the application hangs indefinitely instead of returning the expected result. It's noteworthy that the issue doesn't manifest whenForceReturnValue
is set tofalse
.Upon further investigation, it's observed that even though the application appears to hang, subsequent restarts reveal that the value has indeed been added to the cache. However, the application fails to receive this result.
Expected Behavior:
The expected behavior of the
PutIfAbsent
method withForceReturnValue
set totrue
is to return the previous value associated with the key, which, in this scenario, should benull
since the key doesn't exist prior to the operation.Steps to Reproduce:
PutIfAbsent
method withForceReturnValue=true
.The text was updated successfully, but these errors were encountered: