[Twisted-web] server crashes
stephan
twisted-web@twistedmatrix.com
Tue, 24 Feb 2004 15:09:15 -0800
I do use external libs, but they are all instanced within the thread. I
create a connection to a mysql dbm within each thread but that should not
cause any conflicts since each thread has its seperate connection object.
Personally I suspect the request object. Unfortunately I cannot just
deepcopy it and pass it to the thread.
Is there an alternative way doing this? The only way I can imagine is to
do the threading later down the line which would make it harder to
maintain a version that also runs within apache.
_stephan
On Tue, 24 Feb 2004 14:36:03 -0500, James Y Knight <foom@fuhm.net> wrote:
> Well, the request object certainly doesn't do any locking for
> multithreadeded access, so it could easily be in an inconsistant state
> sometimes. I'd certainly suggest not accessing the request object from a
> different thread, but, that shouldn't cause python to just up and quit
> without any error.
>
> Maybe you can try running it with the python debugger, or if that
> doesn't catch anything, gdb. Are you using any external C libraries?
> (database/etc?) Perhaps one of those isn't multithreaded safe?
>
> James
>
> On Feb 24, 2004, at 2:19 PM, stephan wrote:
>> def render(self, request):
>> threads.deferToThread(handleRequest, request).addCallback(\
>> writeRequestAndFinish, request).addErrback(\
>> request.processingFailed)
>> return server.NOT_DONE_YET
>
>
> _______________________________________________
> Twisted-web mailing list
> Twisted-web@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web