On Tuesday, September 30, 2003, at 04:23 PM, Peter Schuller wrote:
for details) when the client closes the tcp connection prematurely, the
python process/thread runniung the servlet starts looping with 100% cpu
usage.

Ok, I have confirmed that the problem occurrs with mod_webkit aswell.


Also, I have been trying to understand what might be going on. But I cannot
for the life of me find the location in the code where the data actually gets
sent to the client.


HTTPResponse.write() does write the data to _strmOut, but that is a
TASASStreamOut according to the debug output I put in before the write(). The
TASASStreamOut class only puts data in an in-memory buffer (even when
flushing) and I cannot locate where that data is actually pulled out of the
stream and sent to the socket.


In either case, it is clear that

  def createResponseInTransaction(self, transaction, strmOut):
    response = self._responseClass(transaction, strmOut)
    transaction.setResponse(response)
    return response

of Application is giving the actual socket (strmOut) to the response class
which I assume is HTTPResponse (though I can't find it). The constructor of
HTTPResponse passes strmOut to the parent - Response - which sets the
_strmOut instance variable. So it looks to me that trans.response()._strmOut
should be the socket, yet when I attempt to verify that I get a
TASASStramOut, and I have no clue where it came from.

No, strmOut is TASASStreamOut -- that object is created by ThreadedAppServer, and Application never sees the raw socket object. TASASStreamOut does send data on the socket, though only if you do .autoCommit(1).


The problem might be in TASASStreamOut.flush:
    try:
        sent = sent + self._socket.send(self._buffer[sent:sent+8192])
    except socket.error, e:
        if e[0]==errno.EPIPE: #broken pipe
            pass
        else:
            print "StreamOut Error: ", e
        break

This error handling is sub-optimal, to say the least.

Ian



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to