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

[BUG] Reverb Broadcast Stop If Redis Connection Lost #258

Closed
nathanaelytj opened this issue Oct 17, 2024 · 2 comments
Closed

[BUG] Reverb Broadcast Stop If Redis Connection Lost #258

nathanaelytj opened this issue Oct 17, 2024 · 2 comments
Assignees

Comments

@nathanaelytj
Copy link

Reverb Version

1.4.1

Laravel Version

11.28.1

PHP Version

8.3.10

Description

This is a docker swarm setup, and maybe will also be replicable in any other environment.
When redis dropped for whatever reason like redis container restarting or redis container stopped, laravel reverb will print out this error and then it will stop broadcasting messages:

Unhandled promise rejection with RuntimeException: Connection to tcp://10.123.0.9:6379?hostname=redis failed: Connection refused (ECONNREFUSED) in /var/www/vhosts/localhost/vendor/react/socket/src/TcpConnector.php:148

and also this error too after error above:

Next RuntimeException: Connection to tcp://redis:6379 failed: Last error for IPv4: Connection to tcp://10.123.0.9:6379 failed: Connection refused (ECONNREFUSED). Previous error for IPv6: DNS query for redis (AAAA) did not return a valid answer (NOERROR / NODATA) in /var/www/vhosts/localhost/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php:210

Even after the redis container return online and can accept connection, laravel reverb still failed to send any new broadcast messages.

Only after redis is back online and reverb is restarted, laravel reverb will function normally.

Steps To Reproduce

This is the steps to reproduce the bug:

  1. Initialize redis and make sure it's accepting connection.
  2. Start laravel reverb, make sure the log in laravel reverb print out INFO Starting server on 0.0.0.0:6001 (<anyhostname>). and it's accepting any broadcast messages.
  3. Stop redis either by stopping it's container (if it's in docker setup) or the redis service (if it's installed on host).
  4. Make sure the reverb print the error first that it can't connect to redis now.
  5. After reverb print the error, restart the redis. Make sure we can connect to redis and it's accepting connection again.
  6. Now try to send broadcast message through reverb, it will fail to send any broadcast messages.
  7. If reverb is restarted, reverb will function normally again.
@nathanaelytj nathanaelytj changed the title Reverb Broadcast Stop If Redis Connection Lost [BUG] Reverb Broadcast Stop If Redis Connection Lost Oct 17, 2024
Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@nathanaelytj
Copy link
Author

Will probably fixed by #281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants