Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Cache] fix using multiple Redis Sentinel hosts when the first one is not resolvable #51598

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

Conversation

digilist
Copy link
Contributor

@digilist digilist commented Sep 7, 2023

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #51570
License MIT
Doc PR

See ticket #51570 for details on this bugfix.

As mentioned in the ticket, I am not sure if it's wise to catch all exceptions or if it would be better to only check for specific ones. But since I cannot think about any reasons other than an unreachable host to raise any exception, I decided to catch all exceptions for now.

@carsonbot carsonbot added this to the 6.4 milestone Sep 7, 2023
@digilist digilist changed the base branch from 6.4 to 5.4 September 7, 2023 20:43
@digilist digilist force-pushed the 51570-fix-redis-sentinel-only-trying-first-host branch from 1190150 to 4ab66af Compare September 7, 2023 20:45
@digilist digilist force-pushed the 51570-fix-redis-sentinel-only-trying-first-host branch 2 times, most recently from bd789ca to 193af22 Compare September 11, 2023 08:53
@digilist digilist force-pushed the 51570-fix-redis-sentinel-only-trying-first-host branch from 193af22 to 578a152 Compare September 12, 2023 19:54
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 5.4 Sep 14, 2023
@symfony symfony deleted a comment from carsonbot Sep 14, 2023
@nicolas-grekas
Copy link
Member

Thank you @digilist.

@nicolas-grekas nicolas-grekas merged commit 7c4f174 into symfony:5.4 Sep 14, 2023
nicolas-grekas added a commit that referenced this pull request Sep 20, 2023
…sts (digilist)

This PR was merged into the 6.4 branch.

Discussion
----------

[Messenger] Add support for multiple Redis Sentinel hosts

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Similar to #47003 which added support for multiple Redis Sentinel hosts for the Cache component, this PR adds support for multiple Sentinel hosts for the Messenger component.

This PR is inspired by the implementation in the cache component and works very similar. A DSN could look like this: `redis:?host[localhost:26377]&host[localhost:26379]&sentinel_master=db`.

I changed the Sentinel host environment variable for the ingegration to an invalid host at. As a result I noticed that Relay also fails in such case and so I expanded my earlier changes from #51598 to also ignore unreachable hosts with the Relay extension.

Commits
-------

3380518 [Messenger] Add support for multiple Redis Sentinel hosts
This was referenced Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cache] Redis Sentinel only attempting connection via first host with PHP Redis extension
3 participants