59 Commits
Author SHA1 Message Date
zeekayandHanzo Dev e3ee0b50f2 fix(build): repoint go-redis internal imports to hanzoai/kv-go module path and restore lost merge artifacts (internal/rand->math/rand, pool close-reason/metric-state consts, otel/push/util/auth/uberatomic imports)
Co-authored-by: Hanzo Dev <[email protected]>
2026-06-30 16:15:55 -07:00
zeekay 21f34da35a merge: upstream/master (preserve Hanzo brand, 100 commits) 2026-06-02 09:58:21 -07:00
14a9a85363 feat(search): parser resp3 responses for search (#3741)
* parse resp3 responses

* backwards compatibility

* doctests and format

* fix parsing

* remove unused functions

* debug test

* debug test x2 peek directly

* debug test

* remove debug and skip re build

* fix typo

* add tests and fix parsers for resp3

* add comment for the unreliable Total in RESP3 for aggregate

* fix build

* remove shadowing rawVal

* fix strange redis search float,int,string behaviour handling

* mark UnstableResp3 as Deprecated

---------

Co-authored-by: ofekshenawa <[email protected]>
2026-05-21 14:18:35 +03:00
4427a3711a chore(client): invalid memory address or nil pointer dereference in baseClient.initConn (#3676)
* fix(client): Do not try to access pointer field without a nil check

* fix(client): always make copy of options to prevent access client internals

* Client: return options copy

* ClusterClient: add missing nil options check, copy passed options, return
  options copy

* Ring: copy passed options, return options copy

* SentinelClient: copy passed options

* fix(tests): some tests relied on client internal field access

timeout tests now use reflect and unsafe to access clients internal
options

* fix(redisotel): call options method only once for every client

* revert options cloning, but leave nil check in NewClusterClient

reverts e170a61, 9ffb47e, most of the changes in d986ff7

* chore(doc): add note about alteration of options returned from Options()

* revert leftover change, update doc for clients

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
2026-03-23 18:14:15 +02:00
b53f2b0c9d feat(sch): MaintNotifications for ClusterClient (#3643)
* [maintnotif] Cluster specific handlers (#3613)

* maint notification handlers for cluster messages

* unrelax all conns

* trigger ci on feature branches

* feat(maintnotif): lazy cluster topology reload (#3614)

* lazy cluster topology reload

* fix discrepancies between options structs

* Update osscluster_lazy_reload_test.go

Co-authored-by: Copilot <[email protected]>

* Update osscluster.go

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>

* feat(e2e): mock maintnotif e2e tests (#3639)

* lazy cluster topology reload

* fix discrepancies between options structs

* Update osscluster_lazy_reload_test.go

Co-authored-by: Copilot <[email protected]>

* Update osscluster.go

Co-authored-by: Copilot <[email protected]>

* wip fault with mock proxy

* make lint happy

* fix linter issues

* faster tests with mocks

* linter once again

* add complex node test

* add ci e2e

* use correct redis container

* e2e fix

---------

Co-authored-by: Copilot <[email protected]>

* fix(retry): Add retry mechanism for NOREPLICAS error (#3647)

* fix(queuedNewConn): protect against nil context (#3649)

* fix(maintnotif): fix smigrated parser and add cluster state reload interval option (#3663)

* fix SMIGRATED parsing

* fix smigrated parser

* add ClusterStateReloadInterval to ClusterOptions

* fix tests

* set default cluster reload interval to 10s

* chore(lint): format

* feat(smigrated): new format & remember original host:port (#3697)

* lazy cluster topology reload

* fix discrepancies between options structs

* Update osscluster_lazy_reload_test.go

Co-authored-by: Copilot <[email protected]>

* Update osscluster.go

Co-authored-by: Copilot <[email protected]>

* wip fault with mock proxy

* make lint happy

* fix linter issues

* faster tests with mocks

* linter once again

* add complex node test

* add ci e2e

* use correct redis container

* e2e fix

* additional e2e tests

* fix data race

* fix random shard picker

* fix e2e tests

* fix for empty endpoint

* fix case when semaphore is full, but still need to check idle

* scenario tests

* create database from config

* wip

* feat(client): store original addrs for later use

* fix(notif): change smigrated notification

* fix(lint): fix linter

* fix(smigrated): use array

* fix(e2e): wip

* Update options.go

Co-authored-by: Copilot <[email protected]>

* Update redis.go

Co-authored-by: Copilot <[email protected]>

* fix(notif): if the conn has no original addr, trigger reload with first target

* chore(e2e): wip cluster e2e

* chore(e2e): fix nil pointer from e2e tests

* chore(e2e): fix tests and reports

* chore(e2e): proper logging in e2e

* chore(e2e): add pubsub in the tests as well

* chore(e2e): mockproxy fixes

* chore(e2e): mockproxy fixes

* chore(e2e): mockproxy fixes

* chore(e2e): mockproxy fixes v3

* stop background routines

* fix(e2e): tests

---------

Co-authored-by: Copilot <[email protected]>

* chore(docs): add example app (#3651)

* chore(lint): fmt

* chore(docs): improve docs

* chore(docs): update features.md

* chore(github): remove example

* chore(maintnotif): rename option and address pr comments

* fix(e2e): command runner should use client timeout

* chore(e2e): refactor tests

* fix(e2e): set default timeout to 90m

* fix(e2e): skip tests if proxy cannot be started

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
Co-authored-by: Elena Kolevska <[email protected]>
2026-02-13 13:25:07 +02:00
zeekay 24f201b8e5 Rebrand as hanzoai/kv-go
Update module path from github.com/redis/go-redis/v9 to
github.com/hanzoai/kv-go/v9 for use as the Hanzo KV Go SDK.

- Update go.mod module declaration
- Update all Go imports across 260 files
- Update all submodule go.mod files (extra/*, example/*, internal/customvet)
2026-01-19 18:15:43 -08:00
ofekshenawaandGitHub 41dcf382c6 Add digest helper functions for client-side xxh3 hashing (#3679)
* add digest helper functions for client-side xxh3 hashing

* Fix golangci-lint errors
2026-01-19 15:56:10 +02:00
cyningsunandGitHub 1bf873ed6a feat(pool): add ConnMaxLifetimeJitter to prevent connection thundering herd (#3666)
* add connection max lifetime jitter

* refactor calcConnExpiresAt
2026-01-15 17:01:41 +02:00
75ddeb3d5a feat(e2e-testing): maintnotifications e2e and refactor (#3526)
* e2e wip

* cleanup

* remove unused fault injector mock

* errChan in test

* remove log messages tests

* cleanup log messages

* s/hitless/maintnotifications/

* fix moving when none

* better logs

* test with second client after action has started

* Fixes

Signed-off-by: Elena Kolevska <[email protected]>

* Test fix

Signed-off-by: Elena Kolevska <[email protected]>

* feat(e2e-test): Extended e2e tests

* imroved e2e test resiliency

---------

Signed-off-by: Elena Kolevska <[email protected]>
Co-authored-by: Elena Kolevska <[email protected]>
Co-authored-by: Elena Kolevska <[email protected]>
Co-authored-by: Hristo Temelski <[email protected]>
2025-09-26 19:17:09 +03:00
0ef6d0727d feat: RESP3 notifications support & Hitless notifications handling [CAE-1088] & [CAE-1072] (#3418)
- Adds support for handling push notifications with RESP3. 
- Using this support adds handlers for hitless upgrades.

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Hristo Temelski <[email protected]>
2025-09-10 22:18:01 +03:00
cxljsandGitHub e07f55bed1 chore(buffers): Set the default read/write buffer size of Redis connection to 32KiB (#3483)
* update README.md

Signed-off-by: Xiaolong Chen <[email protected]>

* typo: 0.5MiB -> 256KiB

Signed-off-by: Xiaolong Chen <[email protected]>

* Set the default read/write buffer size of Redis connection to 32KiB

Signed-off-by: Xiaolong Chen <[email protected]>

---------

Signed-off-by: Xiaolong Chen <[email protected]>
2025-08-18 20:04:55 +03:00
cxljsandGitHub 8336c44404 chore(client): fix UniversalOptions miss ReadBufferSize and WriteBufferSize options (#3485)
Signed-off-by: Xiaolong Chen <[email protected]>
2025-08-18 15:46:31 +03:00
436979f5c7 feat(options): Clean failing timeout implementation (#3472)
* Fix hard code of failing timeout

1. if not set failing time limit, default is 15 seconds.

* feat: Complete configurable FailingTimeoutSeconds implementation

---------

Co-authored-by: Shino Wu <[email protected]>
2025-08-12 14:08:28 +03:00
0383d08a35 feat(client): Add CredentialsProvider field to UniversalOptions (#2927)
* Add CredentialsProvider field to universal client

* fix(options): Add credentials providers to universal options and pass to client options

* chore(ring): Add missing fields in building clientOptions

---------

Co-authored-by: ofekshenawa <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-06-24 13:28:54 +03:00
Nedyalko DyakovandGitHub d54e848055 feat(options): panic when options are nil (#3363)
Client creation should panic when options are nil.
2025-04-30 09:33:40 +03:00
ofekshenawaandGitHub 2f0a9b720a migrate golangci-lint config to v2 format (#3354)
* migrate golangci-lint config to v2 format

* chore: skip CI on migration [skip ci]

* Bump golangci version

* Address several golangci-lint/staticcheck warnings

* change staticchecks settings
2025-04-29 12:53:06 +03:00
d86395694d Add FailoverClusterClient support for Universal client (#2794)
* Add FailoverClusterClient support + fix example/hset-struct go.sum

* Improve NewUniversalClient comment

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-03-24 14:21:08 +02:00
Nedyalko DyakovandGitHub d236865b0c fix: handle network error on SETINFO (#3295) (CVE-2025-29923)
* fix: handle network error on SETINFO

This fix addresses potential out of order responses as described in `CVE-2025-29923`

* fix: deprecate DisableIndentity and introduce DisableIdentity

Both options will work before V10. In v10 DisableIndentity will be dropped. The preferred flag to use is `DisableIdentity`.
2025-03-19 19:02:36 +02:00
8fadbef84a add readOnly on failover opts (#3281)
* add readOnly on failover opts

add failover that if is True it connects to slaves

* add test

* add test for slave connect

* fix test

* fix tests

* skip Flaky

* add more tests on slave

* add test

* delete file

* Update universal_test.go

enable previously skipped test.

* rm skip from sentinels

* rm tmp files

* Update universal_test.go

don't run sentinel test in RE

* Update universal_test.go

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-03-06 16:53:14 +02:00
7d55118554 feat: support Elasticache cluster mode by introducing IsClusterMode config param (#3255)
Co-authored-by: Rushikesh Joshi <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-02-26 18:25:55 +02:00
Nedyalko DyakovandGitHub d0f921357d fix: add unstableresp3 to cluster client (#3266)
* fix: add unstableresp3 to cluster client

* propagate unstableresp3

* proper test that will ignore error, but fail if client panics

* add separate test for clusterclient constructor
2025-02-07 12:09:49 +02:00
04005cbdc7 Support Resp 3 Redis Search Unstable Mode (#3098)
* Updated module version that points to retracted package version (#3074)

* Updated module version that points to retracted package version

* Updated testing image to latest

* support raw parsing for problematic Redis Search types

* Add UnstableResp3SearchModule to client options

* Add tests for Resp3 Search unstable mode

* Add tests for Resp3 Search unstable mode

* Add readme note

* Add words to spellcheck

* Add UnstableResp3SearchModule check to assertStableCommand

* Fix assertStableCommand logic

* remove go.mod changes

* Check panic occur on tests

* rename method

* update errors

* Rename flag to UnstableResp3

---------

Co-authored-by: Vladyslav Vildanov <[email protected]>
Co-authored-by: vladvildanov <[email protected]>
2024-09-12 11:26:10 +03:00
ofekshenawaandGitHub a32be3d93d Add Suffix support to default client set info (#2852)
* Add Suffix support to defualt client set info

* Change ClientNameSuffix to IdentitySuffix

* add tests
2024-01-04 14:40:14 +02:00
a5fe17472a Option types must propagage missing fields (#2726)
* must propagage missing fields

Signed-off-by: Tiago Peczenyj <[email protected]>

* remove credentials provider from ring

---------

Signed-off-by: Tiago Peczenyj <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
2023-10-30 14:36:44 +02:00
fd13da4fea fix missing fields in different Options (#2757)
* fix missing fields in different Options

* fix missing fields in different Options

---------

Co-authored-by: chenjie199234 <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
2023-10-30 14:35:51 +02:00
ljun20160606andGitHub 391798880c feat: add protocol option (#2598) 2023-05-16 22:02:22 +08:00
monkey92t a872c35b1a feat: add ClientName option
Signed-off-by: monkey92t <[email protected]>
2022-12-28 22:14:52 +08:00
Vladimir Mihailenco 58f7149e38 feat: add ContextTimeoutEnabled to respect context timeouts and deadlines 2022-10-11 10:22:42 +03:00
jianghang baa48a4415 feat(pubsub): support sharded pub/sub 2022-08-04 00:05:22 +08:00
Vladimir Mihailenco f6a8adc50c fix: remove conn reaper from the pool and uptrace option names 2022-07-28 15:17:59 +03:00
Vladimir Mihailenco 4ddd7d1803 chore: remove WithContext 2022-06-05 09:58:05 +03:00
Justin Sievenpiper ab0ccc4741 feat: add support for acl sentinel auth in universal client 2022-02-28 14:55:37 -08:00
ce40cd942a Allow FIFO pool in redis client (#1820)
* Initial commit for FIFO pool

* Change PoolType string to PoolFIFO bool

* Remove redundant type

* add PoolFIFO option to all clients

Signed-off-by: monkey92t <[email protected]>

Co-authored-by: Kim Tae Kwon <[email protected]>
Co-authored-by: monkey92t <[email protected]>
2021-07-16 11:58:01 +08:00
Vladimir Mihailenco d67e2911b9 Update comments 2021-04-08 10:02:22 +03:00
Prashanth Pai 9603556a4d Add PoolStats() to UniversalClient 2020-09-29 21:38:01 +05:30
Dmitry Shmulevich 574c21139d add Sentinel password to UniversalOptions
Signed-off-by: Dmitry Shmulevich <[email protected]>
2020-08-31 08:57:01 -07:00
Vladimir Mihailenco 14c843ef89 gofumports 2020-07-16 09:52:07 +03:00
Vladimir Mihailenco ef82e3705c Add OnConnect context 2020-06-10 10:36:22 +03:00
Vladimir Mihailenco 4440575966 Merge branch 'v8' 2020-05-21 10:16:44 +03:00
filipe oliveiraandVladimir Mihailenco cf6cf7f450 Add AuthACL 2020-05-21 08:59:51 +03:00
Vladimir Mihailenco f5593121e0 Add ctx as first arg 2020-05-19 08:52:38 +03:00
Furkan SenharputluandGitHub 8a0ab1aaa7 Make universal options functions public (#1250)
* Make universal options functions public
2020-01-29 17:36:52 +02:00
Vladimir Mihailenco 53c8a4a6b7 Pass context to Dialer 2019-06-04 14:26:26 +03:00
Vladimir Mihailenco 09eb108738 Allow passing context where possible 2019-06-04 13:30:47 +03:00
Vladimir Mihailenco 3da4357c0c Pass network and addr to dialer 2019-06-04 12:40:36 +03:00
Vladimir Mihailenco 7a91ed0df5 Add AddHook to UniversalClient 2019-05-31 17:40:47 +03:00
Vladimir Mihailenco 8476dfea4a Replace Wrap* with hooks that support context 2019-05-31 16:36:57 +03:00
Andrea Spacca 9d63d8db54 Added WrapProcessPipeline to UniversalClient, wrap c.processTxPipeline in cluster client 2019-04-14 10:56:15 +02:00
Vladimir Mihailenco 0d132966a4 Add missing options to UniversalOptions 2018-08-15 08:44:06 +03:00
Vadim Liman 09b9a99666 Add TLS configuration support for Universal Client 2018-05-11 09:46:09 +03:00