SIGWINCH not working on second on-the-fly binary upgrade

Ilan Berkner ilan at time4learning.com
Tue Nov 15 16:40:40 UTC 2011


Nice find, I think I was experiencing a similar issue with upgrading on the
fly from 1.1.7 to 1.1.9.

On Tue, Nov 15, 2011 at 11:38 AM, Eduardo Habkost <ehabkost at raisama.net>wrote:

> Hi,
>
> I was trying to upgrade nginx from 1.0.9 to 1.0.10 on-the-fly, using
> the process described on the wiki[1], but it looks like it is ignoring
> the SIGWINCH signal I send to it.
>
> bender:~# ps ax -H | grep nginx
> 31603 pts/2    S+     0:00             grep nginx
> 32606 ?        S      0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 32607 ?        S      9:47     nginx: worker process
> 31309 ?        S      0:00     nginx: master process
> /usr/local/nginx/sbin/nginx
> 31310 ?        S      0:00       nginx: worker process
> bender:~# kill -WINCH 32606 # 32606 is the 1.0.9 master process, 31309
> is the 1.0.10 master process
> bender:~# ps ax -H | grep nginx
> 31605 pts/2    S+     0:00             grep nginx
> 32606 ?        S      0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 32607 ?        S      9:47     nginx: worker process
> 31309 ?        S      0:00     nginx: master process
> /usr/local/nginx/sbin/nginx
> 31310 ?        S      0:00       nginx: worker process
>
> After a quick look at the code, it looks like this happened because
> the 1.0.9 process I am running was started during a previous
> 1.0.7->1.0.9 on-the-fly upgrade, and the 1.0.9 master process now
> thinks it is not daemonized (ngx_daemonized is not set on
> initialization if ngx_inherited is set).
>
> I have easily reproduced it by killing nginx completely, making a
> on-the-fly 1.0.10->1.0.10 executable upgrade twice. On the first try,
> SIGWINCH works; after the first upgrade, SIGWINCH stops working. Full
> shell session showing the bug is pasted at the end of my message.
>
> [1] http://wiki.nginx.org/CommandLine#Upgrading_To_a_New_Binary_On_The_Fly
>
> --
> Eduardo
>
>
> Shell session:
>
> bender:~# ps ax -H | grep nginx
> 31678 pts/2    S+     0:00             script -t -a /tmp/nginx.script
> 31679 pts/2    S+     0:00               script -t -a /tmp/nginx.script
> 31684 pts/5    S+     0:00                   grep nginx
> bender:~# /usr/local/nginx/sbin/nginx
> bender:~# ps ax -H | grep nginx
> 31678 pts/2    S+     0:00             script -t -a /tmp/nginx.script
> 31679 pts/2    S+     0:00               script -t -a /tmp/nginx.script
> 31689 pts/5    S+     0:00                   grep nginx
> 31686 ?        Ss     0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 31687 ?        S      0:00     nginx: worker process
> bender:~# kill -USR2 31686
> bender:~# ps ax -H | grep nginx
> 31678 pts/2    S+     0:00             script -t -a /tmp/nginx.script
> 31679 pts/2    S+     0:00               script -t -a /tmp/nginx.script
> 31693 pts/5    S+     0:00                   grep nginx
> 31686 ?        Ss     0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 31687 ?        S      0:00     nginx: worker process
> 31690 ?        S      0:00     nginx: master process
> /usr/local/nginx/sbin/nginx
> 31691 ?        S      0:00       nginx: worker process
> bender:~# kill -WINCH 31686
> bender:~# ps ax -H | grep nginx
> 31678 pts/2    S+     0:00             script -t -a /tmp/nginx.script
> 31679 pts/2    S+     0:00               script -t -a /tmp/nginx.script
> 31695 pts/5    S+     0:00                   grep nginx
> 31686 ?        Ss     0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 31690 ?        S      0:00     nginx: master process
> /usr/local/nginx/sbin/nginx
> 31691 ?        S      0:00       nginx: worker process
> bender:~# echo SIGWINCH worked on the first process
> SIGWINCH worked on the first process
> bender:~# kill -QUIT 31686
> bender:~# ps ax -H | grep nginx
> 31678 pts/2    S+     0:00             script -t -a /tmp/nginx.script
> 31679 pts/2    S+     0:00               script -t -a /tmp/nginx.script
> 31697 pts/5    S+     0:00                   grep nginx
> 31690 ?        S      0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 31691 ?        S      0:00     nginx: worker process
> bender:~# kill -USR2 31690
> bender:~# ps ax -H | grep nginx
> 31678 pts/2    S+     0:00             script -t -a /tmp/nginx.script
> 31679 pts/2    S+     0:00               script -t -a /tmp/nginx.script
> 31705 pts/5    S+     0:00                   grep nginx
> 31690 ?        S      0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 31691 ?        S      0:00     nginx: worker process
> 31702 ?        S      0:00     nginx: master process
> /usr/local/nginx/sbin/nginx
> 31703 ?        S      0:00       nginx: worker process
> bender:~# kill -WINCH 31690
> bender:~# ps ax -H | grep nginx
> 31678 pts/2    S+     0:00             script -t -a /tmp/nginx.script
> 31679 pts/2    S+     0:00               script -t -a /tmp/nginx.script
> 31709 pts/5    S+     0:00                   grep nginx
> 31690 ?        S      0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 31691 ?        S      0:00     nginx: worker process
> 31702 ?        S      0:00     nginx: master process
> /usr/local/nginx/sbin/nginx
> 31703 ?        S      0:00       nginx: worker process
> bender:~# kill -WINCH 31690
> bender:~# ps ax -H | grep nginx
> 31678 pts/2    S+     0:00             script -t -a /tmp/nginx.script
> 31679 pts/2    S+     0:00               script -t -a /tmp/nginx.script
> 31711 pts/5    S+     0:00                   grep nginx
> 31690 ?        S      0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 31691 ?        S      0:00     nginx: worker process
> 31702 ?        S      0:00     nginx: master process
> /usr/local/nginx/sbin/nginx
> 31703 ?        S      0:00       nginx: worker process
> bender:~# echo PID 31690 is ignoring SIGWINCH signals
> PID 31690 is ignoring SIGWINCH signals
> bender:~# kill -QUIT 31690
> bender:~# ps ax -H | grep nginx
> 31678 pts/2    S+     0:00             script -t -a /tmp/nginx.script
> 31679 pts/2    S+     0:00               script -t -a /tmp/nginx.script
> 31713 pts/5    S+     0:00                   grep nginx
> 31702 ?        S      0:00   nginx: master process
> /usr/local/nginx/sbin/nginx
> 31703 ?        S      0:00     nginx: worker process
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



-- 

Ilan Berkner
Chief Technology Officer
Time4Learning.com

6300 NE 1st Ave., Suite 203
Ft. Lauderdale, FL 33334
(954) 771-0914

<http://www.twitter.com/time4learning> <http://www.facebook.com/Time4Learning>


Time4Learning.com - Online interactive curriculum for home use, PreK-8th
Grade.
Time4Writing.com - Online writing tutorials for high, middle, and
elementary school students.
Time4Learning.net - A forum to chat with parents online about kids,
education, parenting and more.
spellingcity.com - Online vocabulary and spelling activities for teachers,
parents and students.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20111115/43760f91/attachment.html>


More information about the nginx mailing list