-
Notifications
You must be signed in to change notification settings - Fork 547
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
Abort long running websockets on shutdown with nginx standalone does not behave as expected #2211
Comments
We are an enterprise customer by the way. |
Have you tried this config option? The default is different in standalone than nginx: https://www.phusionpassenger.com/docs/references/config_reference/standalone/#--no-abort-websockets-on-process-shutdown-abort_websockets_on_process_shutdown |
Setting this you mean:
We use a startup script with passenger command, so I think the default is what we want. |
Hmm yeah, I can reproduce this. Thanks for the report. I'll get on this. |
Could you update the status of this issue please? |
Sorry, there's not much to update currently, I'm still working on it. |
Could you update the status of this issue please? |
@CamJN I can reproduce it too. The problem is as follows:
W.r.t. solutions, we have a few alternatives:
|
Issue report
Question 1: What is the problem?
On shutdown of passenger in combination with nginx standalone with open websockets, these websocket connections should be closed. So that nginx shuts down.
Nginx does not shut down when websocket connections are still open. The default configuration (https://www.phusionpassenger.com/docs/references/config_reference/nginx/#passenger_abort_websockets_on_process_shutdown) says it should abort the websocket connections. This does not happen.
Since nginx gets a graceful kill command Nginx will wait until web sockets are finished.
https://github.com/phusion/passenger/blob/master/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb#L164
Using Rails 5.2 with actioncable on passenger standalone. Open a websocket connection and stop passenger. Keep track of the open processes.
Be as detailed as possible in your descriptions, include any logs and stack traces (don't just cut/paste the error, provide some logging before that too).
When we stop the websocket client ourselves (close the browser window)
(if you are requesting a feature instead of reporting an issue, describe here what you have in mind and how it would help you)
Your answer:
We think there are at least a few options:
term
or remove it like it was by default before:https://github.com/phusion/passenger/commit/80b64fd9d46a60f44995cfc24a5627fbc80aed07#diff-7525566659db4eaa36a7f6b8ac369595
worker_shutdown_timeout
to nginx.confnginx_module
the shutdown of web sockets usingabort_websockets_on_process_shutdown
. Possible in:https://github.com/phusion/passenger/blob/master/src/nginx_module/ngx_http_passenger_module.c#L584
Question 2: Passenger version and integration mode:
nginx/1.14.0 Phusion_Passenger/5.3.6 Standalone
Question 3: OS or Linux distro, platform (including version):
Linux 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64
Question 4: Passenger installation method:
Your answer:
[ ] RubyGems + Gemfile
[x] RubyGems, no Gemfile
[ ] Phusion APT repo
[ ] Phusion YUM repo
[ ] OS X Homebrew
[ ] source tarball
[ ] Other, please specify:
Question 5: Your app's programming language (including any version managers) and framework (including versions):
Ruby 2.5.5, Rails 5.2.3
Question 6: Are you using a PaaS and/or containerization? If so which one?
Your answer:
No
The text was updated successfully, but these errors were encountered: