Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [patch] RedisCache: broaden reconnectOnError condition #90

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

ronjouch
Copy link
Contributor

@ronjouch ronjouch commented Jun 11, 2024

I suspect that the current reconnectOnError callback doing a message.startsWith fails to trigger in cases where the READONLY keyword isn't at the beginning of the error message.

Sadly, this is only a suspicion, as I haven't been able to reproduce cases of failure to reconnect (observed in prod) in local tests triggering a FAILOVER

Regardless, switching to includes ...

, so here's a PR doing so.

I suspect that the current `reconnectOnError` callback doing a
`message.startsWith` fails to trigger in cases where the `READONLY`
keyword isn't at the beginning of the message.

Sadly, this is only a suspicion, as I haven't been able to reproduce
cases of failure to reconnect (observed in prod) in local tests triggering
a `FAILOVER`

Regardless, switching to `includes` ...

- Is what's recommended by https://github.com/redis/ioredis#reconnect-on-error
- Is risk-free
- *May* help in prod/staging (will test after this gets merged)

, so here's a PR doing so.
@ronjouch ronjouch requested a review from ianfdk June 11, 2024 21:44
@ronjouch ronjouch merged commit 270dfea into master Jun 12, 2024
5 checks passed
@ronjouch ronjouch deleted the contains branch June 12, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants