[Varnish] #748: sess_timeout incorrectly used for in-flight requests

Varnish varnish-bugs at varnish-cache.org
Mon Aug 9 23:46:46 CEST 2010


#748: sess_timeout incorrectly used for in-flight requests
--------------------+-------------------------------------------------------
 Reporter:  xb95    |       Owner:  martin
     Type:  defect  |      Status:  new   
 Priority:  normal  |   Milestone:        
Component:  build   |     Version:  2.1.0 
 Severity:  minor   |    Keywords:        
--------------------+-------------------------------------------------------

Comment(by tsuna):

 To be more precise, the bug is in source:trunk/varnish-
 cache/bin/varnishd/cache_acceptor.c#4989 in vca_acct() around line 249
 where the value that's passed to {{{setsockopt()}}} to set the
 {{{SO_RCVTIMEO}}} is initialized incorrectly from
 {{{params->sess_timeout}}}.

 {{{params->sess_timeout}}} is used correctly in the waiter code, e.g. in
 source:trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c#4989 in
 {{{vca_main()}}} around line 192.  It seems to me that someone added a
 timeout in {{{cache_acceptor.c}}} after {{{params->sess_timeout}}} was
 introduced, and the misleading name {{{sess_timeout}}} lead them to
 believe that this was the appropriate timeout to use.  This variable
 should really be renamed {{{idle_timeout}}} or something less confusing
 like that.

 The consequence of this bug, just to make it clearer to the readers not
 too familiar with Varnish, is that a default Varnish config will not wait
 more than 5 seconds for a request to complete.  5 seconds is a hell of a
 lot of time, which is why many people probably didn't notice, but it can
 happen.  Until this is fixed, the workaround is to up {{{sess_timeout}}}
 to whatever request timeout you think is reasonable (by passing {{{-p
 sess_timeout 25s}}} in argument to {{{varnishd}}} – if you want a 25s
 timeout for example).

-- 
Ticket URL: <http://varnish-cache.org/ticket/748#comment:2>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list