Backend polling not working
izak at upfrontsystems.co.za
Thu Oct 15 08:25:52 CEST 2009
Izak Burger wrote:
> I had the same thought, so I took the request as captured with the
> packet grabber and tried it against zope using telnet, and it produces
> the required result. That in itself is perhaps a hint, I think the
> telnet client inserts the correct CRLF sequences which might not be
> immediately apparent.
> Also, if read(2) returns zero it means EOF, so the problem must somehow
> be on the backend. I'll reply again on this thread if I manage to figure
> it out.
When inspecting the network traffic I noticed that the client side
(varnish) sends the first FIN packet, and not the server/backend (zope).
This means that varnish closes the connection without reading the
response. As far as I know, when you specify "Connection: close", the
server will close the connection after the response rather than the
other way round.
I then added some extra log statements to the C code and confirmed that
the do/while loop that is supposed to read the response terminates on
the very first read() call with an EOF.
In other words, there is definitely something wrong with varnish here.
I suspect the problem might be with poll(), although I have yet to
confirm that. Specifically, it seems that the case where poll() returns
-1 is not handled properly. At the least I think it should handle EINTR?
I'll check that later and let you know.
More information about the varnish-dev