httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57520] proxy: worker failure disrupts existing connections
Date Mon, 02 Feb 2015 12:25:05 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=57520

--- Comment #4 from Yann Ylavic <ylavic.dev@gmail.com> ---
(In reply to dk from comment #3)
> 1) Yes, Jetty is being restarted gracefully. I am calling server.stop() and
> then server.join() to ensure the JVM does not exit till all current requests
> finish. All Java-side issues have been sorted out by now

I don't no much about Jetty but, does it accept new connections while
restarting gracefully? The "Connection refused" in the error log seems to
indicate it does not.

> 
> 2) The error that reveals the problem here is a Java exception with "EOF
> while reading" HTTP input stream. This is only possible if the connection is
> closed by Apache - JVM would not do this since Jetty is being stopped
> gracefully and waiting for requests to finish, per above.

Could you provide some network (pcap) traces between the proxy and jetty which
would capture the restart (so that we can figure out what's going on and which
part is closing/resetting the connections)?


> 5) Of course I see "disabling worker" messages. That's the point of the test
> - to ensure that restarting Jetty under heavy load is graceful and does not
> mangle requests in process. Additionally "proxy: error reading status line
> from remote server" messages occasionally appear which may also be
> consistent with the possibility of httpd killing in-process connections when
> a worker is disabled.
> 
> 6) I tried this with or without keepalives (per instructions in Bug 37770)
> and the behavior is consistent. Specifically the tested cases were: 1)
> 'SetEnv proxy-nokeepalive 1' 2) keepalive=On on all balancer workers 3)
> 'KeepAlive 600' within vhost config

Unless "proxy-nokeepalive" (SetEnv) or "disablereuse=on" (ProxyPass' parameter)
are used, the backend (jetty) connections will be reused for
multiple/successive requests.
The time these connections are kept alive between requests (idle) is given by
the parameter "ttl=<seconds>" (ProxyPass'), whereas "keepalive=on" relates to
the TCP-keepalive (not HTTP-keepalive), and KeepAliveTimeout (assuming this is
what you mean with 'KeepAlive 600') applies to client connections (not to
backend's).

By using a ttl= lower than the configured KeepAliveTimeout on the jetty side,
it would prevent the case where the backend closes the connection while the
proxy is reusing it for a successive request, which would lead to the same
"proxy: error reading status line" error since the proxy wouldn't realize
before the connection is read (write would succeed).

This cannot happen with "proxy-nokeepalive" though, backend connections are not
reused and hence a new one is created for each request.
>From mod_proxy point of view, an "error reading" on a newly established
connection means it has been closed/reset on the backend side (whereas a
response is expected).
That's why I think we need network traces to figure out...

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message