Skip to content

Conversation

ggivo
Copy link
Collaborator

@ggivo ggivo commented Feb 28, 2025

Propagate errors in transaction on command queuing (e.g, before actual EXEC). Errors are added as suppressed exceptions when EXEC is processed.

https://redis.io/docs/latest/develop/interact/transactions/

A command may fail to be queued, so there may be an error before EXEC is called.
For instance, the command may be syntactically wrong (wrong number of arguments, wrong command name, ...), or there may be some critical condition like an out of memory condition (if the server is configured to have a memory limit using the maxmemory directive).

(cherry picked from commit 74f3952)

Propagate errors in transaction on command queuing (e.g before actual EXEC).
Errors are added as suppressed exceptions when EXEC is processed.

https://redis.io/docs/latest/develop/interact/transactions/
-A command may fail to be queued, so there may be an error before EXEC is called. For instance the command may be syntactically wrong (wrong number of arguments, wrong command name, ...), or there may be some critical condition like an out of memory condition (if the server is configured to have a memory limit using the maxmemory directive).

 closes redis#4084

(cherry picked from commit 74f3952)
@ggivo ggivo requested a review from Copilot February 28, 2025 18:19
@ggivo ggivo self-assigned this Feb 28, 2025
@ggivo ggivo added this to the 5.2.1 milestone Feb 28, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR backports an extension for EXECABORT to include previous errors in transactions by propagating errors encountered during command queuing as suppressed exceptions.

  • Added a new test in TransactionV2Test.java to validate that queuing errors are captured and propagated.
  • Modified Transaction.java to gather queued command responses and, in case of an EXEC error, attach relevant suppressed exceptions.
  • Adjusted imports in the test file to support new assertions.

Reviewed Changes

File Description
src/test/java/redis/clients/jedis/TransactionV2Test.java Added a test for error propagation before EXEC, ensuring suppressed exceptions are attached.
src/main/java/redis/clients/jedis/Transaction.java Refactored exec() to capture command queuing errors and attach them as suppressed exceptions.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

@ggivo ggivo merged commit 2f01feb into redis:5.2.x Mar 3, 2025
2 of 3 checks passed
@ggivo ggivo deleted the 5.2.x-backport-4084 branch April 23, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant