Skip to content
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

threads hanging on production when using transaction #2695

Open
pianoman4873 opened this issue Apr 10, 2024 · 0 comments
Open

threads hanging on production when using transaction #2695

pianoman4873 opened this issue Apr 10, 2024 · 0 comments

Comments

@pianoman4873
Copy link

Hello,
I have a synchronous method which does the following -

var transaction = _connectionMultiplexer.GetDatabase(0).CreateTransaction();

var returnValueTask = transaction.HashSetAsync(key, KeyValuePairsToHashEntries(keyValuePairs));

transaction.KeyExpireAsync(key, expiry);

var success = transaction.Commit();
if (!success) throw new Exception("transaction failed");

return returnValueTask.Result;

I've load tested it locally (100 threads doing the same to either the same key or different keys ) everything seems to be working fine,
but we've seen in production env that pretty frequently the transactions don't seem to complete ( or take very long to complete ).

Am I doing something wrong in the code ? ( other than the method being synchronous which is a prerequisite ).
Could you suggest an alternative to simulate atomic writing of both the hash and the expiry ?

Thanks in advance !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant