[Varnish] #505: changeset 4046 Breaks AJAX posts.

Varnish varnish-bugs at projects.linpro.no
Mon Sep 28 11:47:00 CEST 2009


#505: changeset 4046 Breaks AJAX posts.
---------------------+------------------------------------------------------
 Reporter:  victori  |        Owner:        
     Type:  defect   |       Status:  closed
 Priority:  high     |    Milestone:        
Component:  build    |      Version:  trunk 
 Severity:  normal   |   Resolution:  fixed 
 Keywords:           |  
---------------------+------------------------------------------------------
Comment (by tfheen):

 (In [4248]) Merge: r4046, r4047, r4183: Change the way we close client
 sessions.

 r4046:
 Change the way we close client sessions.

 Previously we always used SO_LINGER to make sure that all queued data
 got transmitted, no matter under which circumstances we closed the
 client connection.

 Change this so that SO_LINGER is only activated for orderly connection
 closure (ie: "Connection: close" from client or error handling), in
 all other cases (usually the client connecting on us, abandon any data
 queued for transmission.

 This _may_ reduce the tendency of worker threads to get hung up on
 network failures a little bit.

 r4047:
 r4046 forgot to reset SO_LINGER for pipe handling which basically
 broke pipehandling.

 Fixes #505

 r4183:
 Disable SO_LINGER when we time out a connection due to sess_timeout,
 so that we do not RST connections that have still not transmitted
 their
 data.

 Since we were able to get the writev(2) to detach the socket, we
 should
 not end up sleeping in the close(2) either.

 We still RST the socket for all error conditions.

 Ideally I would still like to RST connections that have no outstanding
 data after their sess_timeout, in order to avoid the 2*RTT+misc
 timeouts delays associated with loosing a TCP socket for a client
 that have gone to meet some other IP#.

 In particular with load-balancers, this allows the load balancer to
 declare the session dead right away, and reuse it for something more
 productive.

 Unfortunately, this lacks OS support in all presently released
 OS'es: you cannot ask if a socket is done transmitting what you
 asked it to.

 FreeBSD-8.0 will have experimental support for this (FIONWRITE)
 and I will revisit it in that context.

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/505#comment:3>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list