Hello,

I've run into a problem with evhttp server when client times out on a 
connection. This happened twice now - the first time b/c the battery on a write 
cache went bad and the writes to the disk from our callback handler took long 
time to finish. The second time it was a bad disk which was not disabled by the 
controller fast enough. In both of the cases the delays in our callback handler 
caused the clients to time out. Once the handler is actually done writing the 
data to the disk it tries to reply to the client via evhttp_send_reply().  
Under normal condition this would free the http request. However 
evhttp_connection_start_detectclose() is called as well - and this event gets 
processed before the write event. evhttp_detect_close_cb() which gets called 
calls evhttp_connection_reset(). The evhttp_write event never gets called and 
the requests on this connection never get freed. What happens instead is that 
in a very short time we run out of memory, the system starts to swap out and 
the server is unresponsive.

For my application changing evhttp_connection_reset to evhttp_connection_free 
works fine but I am not sure if that is the correct solution to this problem. 
Can anyone think of anything what I could be doing wrong or should I open a bug 
for this problem?

Thx

--pv
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to