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

Some passenger hooks not working #2103

Closed
alexandergitter opened this issue Jul 23, 2018 · 2 comments

Comments

@alexandergitter
Copy link

commented Jul 23, 2018

Question 1: What is the problem?

Passenger hooks such as attached_processand queue_full_error don't seem to be doing anything, while before_watchdog_initialization and after_watchdog_initialization are working fine.

I have the following lines in my nginx configuration:

passenger_ctl hook_before_watchdog_initialization /usr/local/bin/hook_test.sh;
passenger_ctl hook_after_watchdog_initialization /usr/local/bin/hook_test.sh;
passenger_ctl hook_attached_process /usr/local/bin/hook_test.sh;
passenger_ctl hook_queue_full_error /usr/local/bin/hook_test.sh;

Where hook_test.sh is the following:

#!/bin/bash

echo "hello from $PASSENGER_HOOK_NAME"

I'd expect to see corresponding output with the respective hook names when passenger starts up (watchdog initialization), when an application process has been spawned and around full queue errors (i.e. when I see [Client 2-9] Returning HTTP 503 due to: Request queue full (configured max. size: 3) in the logs)

I see correct output for before_watchdog_initialization and after_watchdog_initialization but not the other two.

Here is some log output for a full queue event (where I would expect queue_full_error):

[ D 2018-07-23 13:21:23.7642 1080/T8 Ser/Server.h:881 ]: [ServerThr.2] 1 new client(s) accepted; there are now 3 active client(s)
[ W 2018-07-23 13:21:23.7644 1080/T8 age/Cor/Con/CheckoutSession.cpp:260 ]: [Client 2-9] Returning HTTP 503 due to: Request queue full (configured max. size: 3)
[ D 2018-07-23 13:21:24.2376 1080/T6 Ser/Server.h:881 ]: [ServerThr.1] 1 new client(s) accepted; there are now 4 active client(s)
[ W 2018-07-23 13:21:24.2377 1080/T6 age/Cor/Con/CheckoutSession.cpp:260 ]: [Client 1-10] Returning HTTP 503 due to: Request queue full (configured max. size: 3)
[ D 2018-07-23 13:21:24.8220 1080/T8 Ser/Server.h:881 ]: [ServerThr.2] 1 new client(s) accepted; there are now 3 active client(s)
[ W 2018-07-23 13:21:24.8222 1080/T8 age/Cor/Con/CheckoutSession.cpp:260 ]: [Client 2-10] Returning HTTP 503 due to: Request queue full (configured max. size: 3)

Here is what I get around the server start (before_watchdog_initialization):

[ D 2018-07-23 13:10:55.6429 1047/T1 age/Sha/Fun/Initialization.cpp:621 ]: Passenger watchdog random seed: 1532351455
[ N 2018-07-23 13:10:55.6430 1047/T1 age/Wat/WatchdogMain.cpp:1297 ]: Starting Passenger watchdog...
[ D 2018-07-23 13:10:55.6452 1047/T1 age/Wat/WatchdogMain.cpp:1157 ]: API server will listen on unix:/tmp/passenger.kbA7PqB/agents.s/watchdog_api
[ I 2018-07-23 13:10:55.6576 1047/T1 Hooks.h:138 ]: Running before_watchdog_initialization hook script: /usr/local/bin/hook_test.sh
hello from before_watchdog_initialization
[ D 2018-07-23 13:10:55.6633 1047/T1 age/Wat/WatchdogMain.cpp:1196 ]: Starting agent: Passenger core
[ D 2018-07-23 13:10:55.6894 1080/T1 age/Sha/Fun/Initialization.cpp:509 ]: Starting agent: Passenger core

Question 2: Passenger version and integration mode:

I'm using passenger-docker (Nginx integration mode):
FROM phusion/passenger-ruby25:0.9.34
Phusion Passenger 5.3.3

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

macOS Sierra (10.12.6) as a host for Docker 18.03.1-ce

Question 4: Passenger installation method:

using the version that comes with passenger-docker

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

Ruby 2.5, RVM

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

passenger-docker on Docker 18.03.1-ce for macOS

@esilverberg

This comment has been minimized.

Copy link

commented Dec 26, 2018

I am seeing similar problems. I am running passenger (5.2.1) on Ubuntu LTS 16.04.5 LTS. My symptoms are the same: hook_before_watchdog_initialization outputs values properly; hook_attached_process and hook_queue_full_error have no effect/consequences. Would love to know what additional debugging steps or resolution is possible; Googling this issue only results in this page, the docs, and not much else.

@CamJN CamJN added this to the 6.0.3 milestone Mar 19, 2019
@CamJN

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

Should be fixed in 6.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.