Commit Graph

18 Commits

Author SHA1 Message Date
Till Krüss dc61d2d81e Report a Relay WATCH abort as an aborted transaction (#1765)
* Return null when a watched key aborts a Relay EXEC

When a watched key aborts EXEC, Redis replies with a null array but
Relay throws "Transaction failed", and RelayConnection returns that as
an error response. The strategy mapped it to null in a catch for a
ServerException, which RelayConnection never throws, so a transaction
aborted by WATCH failed with a ServerException instead of
AbortedMultiExecException and the retry option was ignored.

RelayConnection now returns null for that failure of EXEC, as the
stream connection does for the null array, so every strategy handles it
the same way. The dead catch in NonClusterConnectionStrategy is removed,
and so is the exclusion that kept a Relay connection open when EXEC
fails with an error other than EXECABORT, since a WATCH abort no longer
reaches it. A Relay connection whose EXEC was rejected while MULTI
stays open is now closed like any other.

Client::exec() on a Relay connection returns null after a WATCH abort,
as it does on other connections.

* Add the Relay WATCH abort fix to the changelog
2026-11-18 01:23:58 -07:00
Till Krüss 725b4568b7 Close Relay connections that the server already closed (#1761) 2026-11-13 09:06:55 -07:00
Till Krüss 21deb140e8 Fix Relay SELECT with a non-integer database and add Relay range test (#1751)
Relay::select() throws a TypeError for anything but an integer, where
other connections get an error response from the server. Wrap the call
and return the same error response, so the existing test runs against
Relay and no longer needs a Relay-only counterpart.

Relay warns before sending SELECT for out-of-range databases, so that
test keeps its Relay-specific counterpart.
2026-11-03 10:29:11 -07:00
Till Krüss c29b3c24f3 Improve Relay compatibility even further (#1743) 2026-10-09 17:16:48 -07:00
Till Krüss 307d7e2b6a Fix connection cleanup after interrupted pipelines (#1741)
Disconnect interrupted pipeline connections before they can be reused,
discard remaining commands, and reset running state after PHP errors.
Preserve the original failure when connection cleanup also fails.

Clear the cached connection resource when Relay is closed so the next
command reconnects and replays connection initialization. This fixes
client reuse after an interrupted pipeline disconnects the connection.
2026-10-09 16:57:05 -07:00
Till Krüss 581c5659bd update year in headers 2026-02-23 11:48:06 -08:00
Pavlo Yatsukhnenko 62f4ebcc37 Add AUTH command to Relay connection tests (#1601) 2025-10-20 10:34:31 -07:00
vladvildanov 8bc9a4d432 Merge branch 'v2.x' of github.com:predis/predis into vv-main-2.x-sync 2025-03-31 11:36:25 +03:00
Till Krüss ba66e22c92 bump year to 2025 2025-01-22 09:24:26 -08:00
vladvildanov 0c561b087d Codestyle fixes 2025-01-14 09:41:14 -08:00
vladvildanov e160b316dd Fixed Relay tests 2025-01-14 09:41:14 -08:00
Jiří Bok c83ffa43d8 Make Relay work with Redis cluster (#1397) 2025-01-14 09:41:14 -08:00
Till Krüss 7631d317fd update year 2024-11-21 11:37:10 -08:00
Vladyslav Vildanov 8b464f2a60 Improved connection handshake session (#1431)
* Added pipelining for on-connection commands

* Added server version condition for tests

* Fixed static analysis and codestyle errors

* Improved handshake session

* Updated HELLO retry logic

* Changed incorrect variable

* Added return statement

* Added more test coverage, codestyle fixes
2024-03-04 09:18:46 +02:00
Vladyslav Vildanov 5f70cb1abc Removed NULL assignement for username parameter (#1429)
* Removed NULL assignement for username parameter

* Updated unit test

* More codestyle fixes

* Codestyle fixes
2024-01-15 11:57:18 +02:00
Vladyslav Vildanov d56e32715b Improved Relay integration (#1423)
* Fixed Relay objects structure (#1419)
* Added OSS cluster tests (#1421)

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2023-12-28 10:17:04 -08:00
Jiří Bok 6372661dbf Make Relay work with Redis cluster (#1397) 2023-09-13 09:59:50 -07:00
Till Krüss 946c4b7bd7 [v2.x] Relay support (#1263) 2023-05-09 10:39:00 -07:00