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

Phased-Restart Causes Action Cable Connection Loss on Rails App Restart #3323

Open
AhmedWaleedAhmed opened this issue Jan 29, 2024 · 3 comments

Comments

@AhmedWaleedAhmed
Copy link

Describe the bug

When I use phased-restart to restart my Rails app, the action cable connection is lost because all workers shut down to restart new workers. This causes downtime for the client as the worker should not restart until the connection goes down. The UI interface shows the client's status based on action cable, and when I restart the app for deployment using phased-restart, the worker termination issue occurs.

Puma config:

Puma config:

port        ENV.fetch('PORT') { 4000 }
worker_shutdown_timeout 10000
max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
threads min_threads_count, max_threads_count
workers ENV.fetch("WEB_CONCURRENCY") { 3 }

command line options:

bundle exec pumactl -P ./tmp/pids/ui.pid start

Expected behavior
I anticipate that the master will postpone the shutdown of the worker until the connection has been closed, then initiate the restart for this worker, while also restarting every other worker that does not have open connections.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.2 LTS
  • Puma Version 6.4.2
  • Rails Version 6.0.6.1
@dentarg
Copy link
Member

dentarg commented Jan 29, 2024

This sounds like a feature request more than a bug, going of the current documentation that states Idle persistent connections are gracefully disconnected

@AhmedWaleedAhmed
Copy link
Author

@dentarg So should I close this and open a new issue as a feature request or you could change its type?

@dentarg
Copy link
Member

dentarg commented Jan 29, 2024

No need to create a new issue. I was just setting exceptions / contributing to the discussion. Maybe the title should be tweaked, but we can await feedback from others.

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

No branches or pull requests

2 participants