[Zope] Re: Threading, dtml and performance?!

Dieter Maurer dieter@handshake.de
Tue, 30 Oct 2001 23:29:04 +0100 (CET)

Thomas B. Passin writes:
 > > AFAIK, such a beast does not exist where you can stop a transaction from
 > > pressing a browsers stop button. Web is stateless, so a stop button on a
 > > browser cannot be connected to the servers understanding of finish the
 > > request or don't.
 > >
 > Yes and no.  When you stop the browser, the socket connection closes.  The
 > next time the server tries to use that socket it gets an exception.  Ideally
 > in handling the exception the server should stop the thread in question, but
 > who is to say that really happens?
Ususally, Zope computes the complete response, before it
starts to use the socket again.

This is necessary to provide correct exception handling.
Would Zope start to send part of the response as soon it became
available, then exception handling became difficult when
later an exception is raised (because HTTP does not define

There is a single exception to the above rule:

      "RESPONSE.write" immediately start sending the data.
      After the first "write", there must no be an exception
      anymore for this request...

It may be that the "write" recognizes that its socket were closed,
but I fear, it is separated from the socket by a ZServer channel...