Want to subscribe to topics you're interested in?
Become a Member

Nginx nginx won't stop checking... worker child PPID= exists

Discussion in 'Install & Upgrades or Pre-Install Questions' started by EckyBrazzz, Nov 26, 2020.

  1. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    10:12 AM
    Latest
    Latest
    CMM nginx upgrade has errors. I only can kill this process from another session,


     
  2. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    11:12 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Do you have NGINX_ZERODT='y' enabled in your persistent config file at /etc/centminmod/custom_config.inc Beta Branch - Nginx Upgrade - zero downtime mode.

    It's working as designed when NGINX_ZERODT='y' is enabled. If you don't want this method, then remove NGINX_ZERODT='y' from your persistent config file and recompile Nginx via centmin.sh menu option 5.

    That worker child PPID exists is part of Beta Branch - Nginx Upgrade - zero downtime mode

    With NGINX_ZERODT='y' enabled, zero downtime Nginx upgrades will wait until all Nginx old worker children processes complete their current requests/queues before killing the Nginx worker children so what you see is nginx upgrade routine waiting for Nginx worker child processes to complete their work. Default is with NGINX_ZERODT='n' so zero downtime is disabled so when you do Nginx upgrades, it abruptly terminates existing Nginx child workers to switch to new Nginx updated binary. This means any visitor/nginx connections get terminated immediately and visitors can see Nginx downtime errors.
     
    Last edited: Nov 26, 2020
  3. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    10:12 AM
    Latest
    Latest
    I did not see the PID as you have above @eva2000, so gave the server a reboot.

    Another try to recompile and I did not get this.
     
  4. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    11:12 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Interesting so PPID (parent PID of the nginx process) was missing. The value of PPID is derived from this line in inc/nginx_upgrade.inc
    Code (Text):
    GETNGXPPID=$(ps awx -o pid,ppid,command | grep 'nginx: master' | egrep -v '(nginx_upgrade|amplify|php-fpm|hhvm)' | egrep -v grep | awk '{print $1}')

    for routine at centminmod/centminmod
    Code (Text):
    while [[ "$(ps awx -o ppid,command | grep 'nginx: worker' | egrep -v '(nginx_upgrade|amplify|php-fpm|hhvm)' | egrep -v grep | awk '{print $1}' | uniq)" = "$GETNGXPPID" ]]; do
    echo " checking... worker child PPID=$GETNGXPPID exists"
    sleep 3
    done
    

    which inspects nginx worker processes' parent process ID and if it still match the old Nginx binary, wait until it doesn't match the old Nginx binary process ID. At which stage, you kill Nginx master old binary to replace it with updated Nginx binary.

    Seems like your old nginx binary's master process died before the child workers completed and thus was empty for $GETNGXPPID variable.

    That is probably why then, you killed the old nginx binary's process so NGINX_ZERODT routine couldn't complete as it couldn't find the old nginx binary process. You should in future let the waiting for worker child checks to complete if you have optional NGINX_ZERODT='y' enabled for Nginx zero downtime upgrades. The check wait can be lengthy if you old Nginx worker children process have a lot of queued work to complete first before switching to new Nginx upgraded binary.
     
    Last edited: Nov 27, 2020