On Wed, Jan 25, 2012 at 12:23 AM, Roberto De Ioris <[email protected]> wrote: > >> On Tue, Jan 24, 2012 at 12:06 AM, Roberto De Ioris <[email protected]> >> wrote: >>>> On Mon, Jan 23, 2012 at 3:09 AM, Roberto De Ioris <[email protected]> >>>> wrote: >>>> >>>> when stepping the code, Py_IsInitialized() does return true, but deep >>>> within python routines threadstate_getframe receives (and tries to >>>> dereference) a null pointer. >>>> >>>> >> >> ... which loops forever until killed. if --pyshell was "oneshot", you >> could pipe an initialization script into uWSGI, execute it, let the >> hijacked worker die, then respawn as a regular worker ... this might >> be useful for other scenarios too. >> >> so ... removing uWSGI handlers and only giving the hijacked worker one >> life == no unbound looping, a neat way to pipe commands into uWSGI, >> and clean shutdown in all cases i can think of. >> >> thoughts? >> >> > > I like the idea of piping code to the pyshell and soon after restore the > process in normal worker mode. > > I have added the --pyshell-oneshot option > > I have added code for restoring terminal settings if the pyshell dies, > this should avoid clobbered terminals/screen too > > In non-oneshot mode, the pyshell will continue to respawn after a pipe > code injection. To avoid that we should make an ultra-complex dance with > file descriptors. As i do not see reason to use --pyshell with piped code, > i will leave the implementation as is. If in the feature someone came up > with an idea requiring that i will investigate furhter. For now the > official answer is "use --pyshell-oneshot to pipe code" > > Many thanks for your support.
ha, that was quick :-) ... my brain has been page faulting every 20 seconds for the last 2hrs as i tried to implement this and continue to learn C at the same time (which uWSGI by the way, being relatively small + interacting with oodles of kernel/library calls, has been fantastic resource). all looks good here! i can't think of a reason to pipe or modify stdin when using --pyshell either ... i'm fine with the -oneshot variant; it will suite my needs well. double thanks for the terminal restore too ... that's been bugging me :-) -- C Anthony _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
