[mod_python] Re: child process XXXX still did not exit, sending a SIGTERM

Martin Blais blais at furius.ca
Wed Jan 4 00:04:32 EST 2006


On 1/4/06, Martin Blais <blais at furius.ca> wrote:
> On 1/3/06, Graham Dumpleton <grahamd at dscpl.com.au> wrote:
> >     /* XXX */
> >                                                     PyThreadState *tstate;
> >     PyObject *key, *value;
> >     char *name;
> >     int pos = 0;
> >
> > #ifdef WITH_THREAD
> >     PyEval_AcquireLock();
> >
> >     while (PyDict_Next(interpreters, &pos, &key, &value)) {
> >         name = PyString_AsString(key);
> >         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, 0,
> >                      "%d interpreter %s", getpid(), name);        if (strcmp(name,MAIN_INTERPRETER) != 0) {
> >             idata = (interpreterdata *)PyCObject_AsVoidPtr(value);
> >             tstate = idata->istate->tstate_head;
> >             PyThreadState_Swap(tstate);
> >             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, 0,
> >                          "%d end interpreter %s", getpid(), name);
> >             Py_EndInterpreter(tstate);
> >             PyThreadState_Swap(NULL);
> >             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, 0,
> >                          "%d done interpreter %s", getpid(), name);
> >         }
> >         else
> >         {
>
> BTW, I think that right here you need to setup a thread-state and call
> Py_EndInterpreter for those other interpreters as well, no?

Oopsy, sorry, I misread.  This is indeed what you're doing.  Never
mind.  Me tired.



More information about the Mod_python mailing list