[Twisted-web] server crashes

Christopher Armstrong twisted-web@twistedmatrix.com
Tue, 24 Feb 2004 18:35:17 -0500


This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigDF4357F0EFAA6FD22FB010F1
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

stephan wrote:
> 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.

If you make _any_ calls to Twisted code, put them in a 
reactor.callFromThread(func). It runs the function in the main thread.

But you shouldn't suspect the request object, because plain Python code 
won't make python simply die without error. Third party C code is almost 
always the culprit in stuff like that.

-- 
  Twisted | Christopher Armstrong: International Man of Twistery
   Radix  |          Release Manager,  Twisted Project
---------+           http://radix.twistedmatrix.com/

--------------enigDF4357F0EFAA6FD22FB010F1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAO9+1Np279O1/OG4RArH6AJ0TFlqJT+d9rmQb2oUL5PWWyFJ+9wCeKfw7
4ZHyRTFQIGVOQeXcllvV2A4=
=Z8WC
-----END PGP SIGNATURE-----

--------------enigDF4357F0EFAA6FD22FB010F1--