Clarify, which methods are retrying connection/operation automatically #2789
Unanswered
dev-maniac
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello.
I implemented redis through an existing PSR-16 adapter (symfony-cache). On Server-Side I'm using three valkey instances with sentinel and haproxy (to be stack-agnostic - also because I'm also using redis session save handler which does not support sentinel, yet).
Now I've tried to configure a
retry_intervalbut it always seemed as if phpredis did not retry operations (I triggered valkey failovers to test this).Upon further inspection and trying to look into phpredis code (I'm not that firm in C) I think I figured out, that phpredis does disable retries e.g. for bulk-operations (mget/mset), which does make sense, since we wouldn't know how much of the operation succeeded.
And symfony-caches PSR-16 adapter uses it's "normal" PSR-6 adapter which always triggers
doFetch()which ALWAYS usesmgetto fetch keys, even for a single one.So I wondered which methods/operations will retry automatically and which won't. I also think that the
connect()method does not retry automatically (also seems so in code).May this be interesting for the documentation/readme? If someone (like me) wants to build the connection to redis/valkey resilient/retrying (e.g. on master change), this could be interesting so that manual retry can be implemented.
All reactions