Commit Graph

233 Commits

Author SHA1 Message Date
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
Michał "DualFroz" Fox b00c1f810d Use SENTINEL REPLICAS for Sentinel replica discovery (#1745)
* Use SENTINEL REPLICAS for Sentinel replica discovery

* Add a connected Sentinel replicas test
2026-10-12 11:13:39 +03: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 78c91a5628 Support numbered databases in Valkey clusters (#1742) 2026-10-09 08:11:13 -07:00
holystix 97ce126b9f Retry cluster slot map discovery on StreamInitException (#1717)
queryClusterNodeForSlotMap() overrides Retry's default catchable exception
list with [ConnectionException::class]. StreamInitException extends
PredisException directly, so a CLUSTER SLOTS refresh that cannot open a
connection to the node it was redirected to is neither retried nor allowed
to fall back to another node: the fail callback that evicts the unreachable
node never runs, and the exception escapes uncaught.
2026-10-08 09:36:04 -07:00
Till Krüss 5a9a7665cb Fix cluster transaction cleanup and CAS behavior (#1735) 2026-10-07 10:02:58 -07:00
Iain 0f3f616edb Fix infinite loop when the connection closes partway through a bulk reply (#1731) 2026-10-06 09:39:22 -07:00
Midhun Monachan ed2ddeede5 Fix client iteration with master/slave and Sentinel replication (#1730)
* Fix client iteration with master/slave replication

* Fix client iteration with Sentinel replication

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2026-09-30 10:57:38 +03:00
Vladyslav Vildanov 3edc442e55 Fixed CRLF command smuggling and node misrouting in AbstractAggregateConnection::write() and CommandInterface::deserializeCommand() (#1728)
* Fixed CRLF command injection / smuggling in AbstractAggregateConnection::write()

* Revert "Fixed CRLF command injection / smuggling in AbstractAggregateConnection::write()"

This reverts commit a4720b03ee.

* Fixed CRLF command smuggling and node misrouting in AbstractAggregateConnection::write() and CommandInterface::deserializeCommand()

* Revert change
2026-09-16 10:01:26 +03:00
Vladyslav Vildanov 37490865cc Fixed Stream::write()/read() leaving a dead connection when a host error handler throws exception (#1726) 2026-09-14 11:32:59 -07:00
Lazizbek Ergashev e7b89c14b7 Fixed client_info connection parameter being ignored (#1722)
* Fixed `client_info` connection parameter being ignored
* Documented the default value of the `client_info` parameter
2026-09-10 15:24:31 -07:00
Vladyslav Vildanov ac3142abfe Added experimental support for HIMPORT bulk hash import feature (#1712)
* Added support for HIMPORT bulk hash import feature

* Fixed pre-server execution registry miutating, added pre-loaded registry feature

* Refactored retry logic to use existing configuration

* Marked feature as experimental

* Remvoed non-ASCII chars

* Ensure IteratorAggregator interface is enforced

* Fixed bug with updateCachableException adds duplicate entries

* Added explicit reconnect for Relay tests

* Testing with custom image

* Removed redundant comment

* Fixed exception handling

* Removed non-ASCII char

* Fixed merged conflict bugs
2026-08-10 10:54:34 +03:00
Vladyslav Vildanov 09b8ce59dd Fixed Sentinel does not wipe servers on exception caused (#1694) 2026-06-22 10:55:28 -07:00
Vladyslav Vildanov b2d1397fc6 Fixed SENTINEL SLAVES RESP3 incompatible response (#1676)
* Fixed SENTINEL SLAVES RESP3 incompatible response

* Updated CHANGELOG.md

* Revert relay-incompatible annotations
2026-05-14 09:56:32 +03:00
Vladyslav Vildanov ae4a706b01 Fixed Sentinel retry to narrow retryable exceptions to CommunicationException (#1665)
* Fixed Sentinel retry to narrow retryable exceptions to CommunicationException

* Update CHANGELOG.md
2026-04-20 10:10:15 +03:00
Kevin Rojas bb37322a24 Handle -READONLY as a redirection signal for Redis Cluster (AWS ElastiCache support) (#1656)
* feature: Added support for READONLY responses from AWS Elastic Cache

* chore: improve -READONLY handler comment and add changelog entry (#1656)

* tests: add unit test demonstrating ServerException behavior with READONLY error
2026-03-23 09:00:26 +02:00
Till Krüss 87390e7381 Use static closures (#1652) 2026-03-09 13:30:46 -07:00
Vasil Chomakov 7388d91153 Add upstream_driver option for CLIENT SETINFO upstream reporting (#1645)
* Add driver_info option for CLIENT SETINFO upstream reporting

* Use null default for upstreamDriver and ternary operator

* Remove redundant null initialization

* fix: remove trailing newline from VERSION file

* fix: update copyright year to 2026 in DriverInfo files

* refactor: rename driver_info to upstream_driver

* fix: code style issues

* docs: update CHANGELOG to reflect upstream_driver rename
2026-03-05 17:05:02 +02:00
Vladyslav Vildanov 274cb866bd Fixed Sentinel getParameters() executed on string configuration (#1649) 2026-02-26 11:01:54 -08:00
Till Krüss 581c5659bd update year in headers 2026-02-23 11:48:06 -08:00
Vladyslav Vildanov 6c9de258be Fixed getParameter() call on array + added integration testing with Sentinel (#1636)
* Fixed getParameter() call on array + added integration testing with Sentinel

* Added sentinel.conf

* Updated CHANGELOG.md

* Added handling of ParametersInterface
2026-02-13 11:30:43 +02:00
Vladyslav Vildanov 7c7cf90152 Improve connection handshake by pipelining commands (#1622)
* Improve connection handshake by pipelining commands

* Added exceptions handling for Redis < 6.0

* Updated CHANGELOG.md
2026-01-08 13:56:55 +02:00
Vladyslav Vildanov 980326d5d8 Added retry support (#1616)
* Initial work on retries

* Added retry class and test coverage

* Added support for standalone and cluster

* Make TimeoutException instance of CommunicationException

* Added pipeline, trasnaction, replication support

* Fixed broken test

* Marked test as relay-incompatible

* Marked test as relay-incompatible

* Fixed analysis errors, added missing tests

* Codestyle fixes

* Fixed test

* Update README.md

* Update README.md

* Update README.md

* Updated README.md

* Refactor retry on read and write

* Added check for timeout value

* Updated README.md

* Fixed README.md

* Codestyle changes

* Added missing coverage

* Added missing test coverage

* Removed comments

* Added retry support for Relay connection (#1620)

* Added integration test case with mocked retry

* Changed client initialisation in tests

* Marked test as relay-incompatible

---------

Co-authored-by: Pavlo Yatsukhnenko <yatsukhnenko@users.noreply.github.com>
2025-12-23 10:40:46 +02:00
Pavlo Yatsukhnenko 62f4ebcc37 Add AUTH command to Relay connection tests (#1601) 2025-10-20 10:34:31 -07:00
Viktor Szépe d9dfefd247 Fix typos (#1579) 2025-10-03 16:22:43 -07:00
ridgey-dev 8e7afbe679 Retry all exceptions from Sentinel replicas (#1577)
* Retry SentinelReplication::retryCommandOnFailure on all classes with Throwable interface

* Retry SentinelReplication::retryCommandOnFailure on all classes with Throwable interface

* Fix coding style
2025-07-18 09:21:40 +03:00
Vladyslav Vildanov c2b95dfd2a Backport #1551 (#1552)
* fix(conn): Removed automatic conn_uid assignment (#1551)

* fix(conn): Removed automatic conn_uid assignment

* Restrict redis version

* Updated CHANGELOG.md

* Added test case

* Update CHANGELOG.md

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>

* Removed duplicated disconnect

* Updated CHANGELOg.md

---------

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2025-06-05 18:34:21 +03:00
Vladyslav Vildanov d7f60099a6 fix(stream): Fixed throwing CommunicationException when stream is EOF (#1548)
* fix(stream): Fixed return type to match function signature

* Updated CHANGELOG.md

* Fix syntax error

* Updated CHANGELOG.md entry
2025-05-30 10:26:17 +03:00
Mustafa AKBEL 6021daf9cd Treat LOADING Errors as Connection Failures to Retry with Next Replica (#1536)
* fix(sentinel-replication): Treat LOADING error responses as ConnectionException to allow retry mechanism to discard the current replica and switch to the next available one.

* fix(sentinel-replication): add changelog entries for LOADING response handling

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: Mustafa AKBEL <mustafa.akbel@pusula.net.tr>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
2025-05-28 15:11:13 +03:00
Vladyslav Vildanov 06c904af37 fix(auth): Adds default user if only password used for authentication (#1535) 2025-05-13 09:01:21 -07:00
vladvildanov ebcf7809ea Removed empty files 2025-04-01 10:56:51 +03:00
vladvildanov bf526cc129 Codestyle fixes 2025-03-31 12:14:37 +03: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
Vladyslav Vildanov 86e6804c80 fix(stream): Removed resource disconnection on GC (#1519)
* fix(stream): Removed resource disconnection on GC

* Added disconnect for persistent conenctions tests
2025-03-07 10:30:42 +02:00
Vladyslav Vildanov 7b1558abfa Backport #1510, #1513 (#1514) 2025-02-25 09:13:40 -08:00
Vladyslav Vildanov 8b240d15a5 Backport #1512 (#1515)
* Backport #1512
* Removed outdated test
2025-02-25 09:12:10 -08:00
Vladyslav Vildanov 09e88b6fd0 fix: Bug with single persistent connection to the same resource (#1512)
* fix: Bug with single persistent connection to the same resource

* Fixed tests

* Additional test fix

* Codestyle fixes
2025-02-24 09:51:55 +02: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 c5fdfc81ef Added tests case with FLOAT16 and BFLOAT16 vectors (#1465)
* Added tests case with FLOAT16 and BFLOAT16 vectors

* Added version restriction for test

* Updated version restrictions
2024-06-28 11:18:07 -07:00
Christian Flothmann e83b393e09 explicitly mark nullable parameters as nullable (#1448)
* explicitly mark nullable parameters as nullable
* add job to run tests with PHP 8.4
2024-04-30 12:14:13 -07:00
Vladyslav Vildanov c83ee6a809 Implemented PSR-7 compatible stream abstraction (#1450)
* Implemented PSR-7 compatible stream abstraction

* Added missing coverage, fixing static analysis issues

* Fixed return type

* Added missing throws statements

* Added ignore lines
2024-04-10 12:52:53 +03:00
Vladyslav Vildanov 40d72d716d Improved pipeline abstractions (#1438)
* 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

* Improved pipelining abstractions

* Fixed unit tests

* Fixed typo

* Fixed another typo

* Fixed another typo

* Updated deserializeCommand signature

* Codestyle fixes

* Codestyle fixes

* Changed pipelined sequence

* Removed redundant method

* Fixed classname
2024-03-07 15:38:04 +02: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 4b28ab1c74 Codestyle changes (#1437) 2024-02-23 10:18:22 +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