Il giorno 04/mag/2012, alle ore 10:52, Marcin Deranek ha scritto:

> Hi,
> 
> During Zerg dance (uwsgi 1.1.1) I rely on worker statuses to make sure
> we do not stop workers which are still handling requests. Initially I
> was checking if all workers are in "pause" state. Apparently that
> wasn't enough for cheap mode, so I added "cheap" state as well. Today I
> ran into a situation when I had single worker in "idle" state even
> though I paused an old uwsgi instance:
> 
> Fri May  4 09:47:47 2012 - Respawned uWSGI worker 23 (new pid: 24179)
> Fri May  4 09:47:50 2012 - *** psgix.harakiri.commit requested ***
> Fri May  4 09:47:50 2012 - ...The work of process 24179 is done. Seeya!
> Fri May  4 09:47:50 2012 - *** PAUSE (press start to resume, if you do not 
> have a joypad send SIGTSTP) ***
> Fri May  4 09:47:50 2012 - *** worker 6 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 9 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 15 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 2 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 13 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 24 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 18 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 14 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 16 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 19 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 1 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 7 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 3 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 5 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 4 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 11 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 8 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 20 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 10 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 12 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 17 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 21 suspended ***
> Fri May  4 09:47:50 2012 - *** worker 22 suspended ***
> Fri May  4 09:47:50 2012 - Respawned uWSGI worker 23 (new pid: 24183)
> 
> Seems like worker 23 was recycled while pausing an old instance and
> that was the reason it ended up with "idle" state. Shouldn't we create
> new workers in "pause" state when master instance was paused ?
> Regards,
> 
> Marcin
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

I think adding a check for "paused state" will be enough:

http://projects.unbit.it/uwsgi/browser/master.c#L729

if  uwsgi.workers[0].suspended is 1 it means uWSGI is paused


--
Roberto De Ioris
http://unbit.it
JID: [email protected]

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to