Transaction exec sometimes returns null response
See original GitHub issueExpected behavior
When running the following code:
jedis.watch(key);
Transaction t = jedis.multi();
t.incr(key);
List<Object> response = t.exec();
jedis.unwatch();
if (response != null && response.size() == 1) {
jedis.expire(key, expiry);
return (Long)response.get(0);
} else {
LOGGER.error(String.format("Unexpected response size. The response was %s for key %s and expiry %d",
response, key, expiry));
return null;
}
That logger statement should never occur, because if there was no exception until that point then there should always be exactly one item in the list of responses.
Actual behavior
On rare occasion, the response object is null.
This logging statement is available: “Unexpected response size. The response was null for key my_key and expiry 31536000”
Steps to reproduce:
Unknown. Cannot reproduce consistency.
Redis / Jedis Configuration
Jedis version: 2.8.0
Redis version: 6.2.4
Java version: 1.8
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Redis MULTI transaction randomly returning null on EXEC ...
Redis MULTI transaction randomly returning null on EXEC callback in NodeJS · 1. Sounds like you have a race condition somewhere. Are you...
Read more >Impossible to log errors after dooming a transaction within an ...
There is a way to first write a 'custom' log entry by using raiserror with LOG. It is going to raise the error...
Read more >Transactions | Redis
If EXEC fails (i.e. returns a Null reply) we just repeat the operation. Redis scripting and transactions. Something else to consider for transaction...
Read more >Lettuce Reference Guide
The response related to the execution of the command is received at the moment the EXEC command is processed, and the transaction is...
Read more >Serverless SQL pool self-help - Azure Synapse Analytics
Execute any query, for example, SELECT 1 , on serverless SQL pool ... Incorrect network configuration is often the cause of this behavior....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@spmason In short, could be.
Thanks. It’s good to have confirmation.
So then this issue could be explained by an overlapping transaction on the watched key?