passenger icon indicating copy to clipboard operation
passenger copied to clipboard

Passenger not shutting down gracefully.

Open NavindrenBaskaran opened this issue 4 years ago • 18 comments
trafficstars

Issue report

Question 1: What is the problem?

  • What is the expected behavior?

We expect Passenger to shut down gracefully.

  • What is the actual behavior?

Passenger is not shutting down gracefully. When we issue the bundle exec passenger stop command Passenger fails with

Stopping web server...bundler: failed to load command: passenger (/opt/app/vendor/bundle/ruby/2.5.0/bin/passenger)
PhusionPassenger::DaemonController::StopTimeout: Daemon 'PassengerAgent watchdog' did not exit in time
  • How can we reproduce it? Please try to provide a sample application (or Virtual Machine) demonstrating the issue. Otherwise, if we can't reproduce it, we might have to ask you a number of followup questions or run certain commands to try and figure out the problem.
  1. Start passenger with bundle exec passenger start
  2. Issue bundle exec passenger stop from a different terminal.

passenger-log.txt

Question 2: Passenger version and integration mode:

Open Source 6.0.4 standalone

Question 3: OS or Linux distro, platform (including version):

Ubuntu 18.04.5 LTS

Question 4: Passenger installation method:

RubyGems + Gemfile

Question 5: Your app's programming language (including any version managers) and framework (including versions):

Ruby, Rails 4.2.11.1

Question 6: Are you using a PaaS and/or containerization? If so which one?

AWS EKS 1.17, Docker version 19.03.6, build 369ce74a3c

Question 7: Anything else about your setup that we should know?

Environment Variables

PASSENGER_PORT=80
PASSENGER_MAX_POOL_SIZE=10
PASSENGER_POOL_IDLE_TIME=180
PASSENGER_MAX_REQUESTS=10000
PASSENGER_LOG_FILE=/dev/stdout
PASSENGER_ENGINE=builtin
PASSENGER_DISABLE_SECURITY_UPDATE_CHECK=true
DISABLE_ANONYMOUS_TELEMETRY=true
PASSENGER_LOG_LEVEL=7

NavindrenBaskaran avatar Feb 14 '21 08:02 NavindrenBaskaran

Hey there is no update for this issue yet, is the information provided not sufficient? Kindly let me know please. Thank you!

NavindrenBaskaran avatar Feb 17 '21 04:02 NavindrenBaskaran

Sorry I just haven't had time to look into this yet. I'll get to it.

CamJN avatar Feb 17 '21 19:02 CamJN

Okay noted @CamJN. Thank you so much for replying.

NavindrenBaskaran avatar Feb 18 '21 01:02 NavindrenBaskaran

hey @CamJN apologies, would like to ask if you had time to look at this issue?

NavindrenBaskaran avatar Feb 23 '21 02:02 NavindrenBaskaran

Hi I just setup a test environment of Docker running an Ubuntu 18.04.5 container with ruby 2.5.1p57, passenger 6.0.4, rails 4.2.11.1, and the environment variables you listed in your issue report.

Unfortunately running bundle exec passenger start in one terminal and then docker exec'ing into the same container to run bundle exec passenger stop from another terminal did not reproduce the issue for me. Would it be possible to provide a Dockerfile that reproduces the issue? That would be a big help.

CamJN avatar Feb 23 '21 18:02 CamJN

Not sure if Github ate your comment, but if you want to share a Dockerfile via email that's fine. You can reach me at [email protected].

CamJN avatar Feb 23 '21 19:02 CamJN

Hey @CamJN have shared it via email, thank you.

NavindrenBaskaran avatar Feb 23 '21 19:02 NavindrenBaskaran

hey @CamJN may I ask, if we were able to reproduce the issue using the shared dockerfile ? Thank you.

NavindrenBaskaran avatar Mar 02 '21 01:03 NavindrenBaskaran

Hey @CamJN would like to follow up on this.

NavindrenBaskaran avatar Mar 07 '21 19:03 NavindrenBaskaran

It would be helpful if you could help us understand if this is an issue at passenger's end.

NavindrenBaskaran avatar Mar 07 '21 19:03 NavindrenBaskaran

I'm currently trying to build the image, the dockerfile installs ruby 2.3 as a dependency of some apt package which i believe is interfering with the later steps.

CamJN avatar Mar 08 '21 17:03 CamJN

The ruby-dev package you install in your Dockerfile is for the system ruby (2.3). You want the ruby headers for 2.5 which are already installed at /usr/local/include/ruby-2.5.0/ruby/ruby.h.

CamJN avatar Mar 08 '21 22:03 CamJN

hey @CamJN would like to follow up on this.

NavindrenBaskaran avatar Apr 21 '21 06:04 NavindrenBaskaran

I believe this is because of the 15 seconds default stop timeout, if the graceful shutdown takes more than 15 seconds then we will have this error raised.

Is there a way for us to increase this @CamJN ?

NavindrenBaskaran avatar Apr 21 '21 15:04 NavindrenBaskaran

Not at the moment, we can change this issue into a feature request though if you like.

CamJN avatar May 03 '21 15:05 CamJN

Yea, I think it will be great if we could do this. I would be able to contribute on this and will need your help to point me in the right direction here.

NavindrenBaskaran avatar May 04 '21 01:05 NavindrenBaskaran

I think step one would be to just pass a higher stop timeout directly in the code, and see if that helps. If it does then we can talk about how to plumb in a new option.

CamJN avatar May 04 '21 17:05 CamJN