[Zope-dev] Zope (or Python?) not completely thread-safe...?!

Jim Fulton jim@digicool.com
Fri, 11 Feb 2000 11:05:03 -0500


Thilo Mezger wrote:
> 
> hi!
> 
> i spent several hours looking for a bug which caused my whole zope
> system to be hanging.  the solution was this:
> 
> i've been using <dtml-sendmail> to send out emails but due to a
> network change my smtp-host had changed and i was trying to use
> a server that wasn't answering to my smtp-request due to some
> firewall-something.
> 
> ok, one zope thread was waiting for a reply from the smtp-server
> but as a consequence all other zope threads were blocked in some
> way so that i couldn't access my zope system anymore.
> 
> is that a normal behaviour...?!  OS is linux-2.2 ...

Not in general. Apparently the smtp code is making some call
that is blocking the interpreter.

> i would have expected one thread to be waiting and the others to be
> serving requests as usual...

Me to. In general, that's the case.  Someone should dig into the 
SMTP code to see where the interpreter is being blocked.

FWIW, I'd like to see SMTP work quite a bit differently.
First, I'd like to see SMTP sending delayed until transaction commit.
Second, I'd like to see sending done asynchronously.  It would be
nice, when using ZServer, to take advantage of asyncore to send email
messages.

Jim


--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org    

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.