-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infinite loop on windows graceful restart with proxy websocket #277
Comments
I am a bit confused. Does the browser make WebSocket connections over HTTP/2? It should not, if the server does not support it. Is this another request that produces the infinite loop? Strange. Can you produce a log with |
same for me cause my big picture understanding is that in this situation,
no, over HTTP/1.1
just have this relevant: |
Hi @icing, To be clear:
But as you said, I’m not sure that the infinite loop is originated by a gracefully restarted websocket cnx!
As it’s difficult to work on Windows with tracing on a “kill & up process fork” and as I’m not fluent with APR, would it be possible to give a tmp patch (better than mine... easy ;) to trace which request are stuck in the infinite loop? |
If mod_http2 is indeed polling in a loop, as your stacktrace indicates, something weird is going on. The trace is a call from I think we really need a log from such a case with |
Hi @icing,I'm back on it
Changes since last month:
I'll keep you posted... |
Thanks for the update. This is a mysterious one indeed. |
Hi @icing, I think I've caught the loop
Here is the full 2 minutes httpd-error.log
That's the context. If you need more traces, information... just tell me |
Hi @icing, I sometime continue diging on this issue and as my dbg is currently “hot” with another bug (php), Here are the new some fresh traces and clues. just to reminde
⏩ Affected thread only hang some h2 (non websocket) connection de be closed (at least I've never seen) Ex.
I always have the same call stack :
refreshing the stack, line only change in impl_pollset_poll() method
This confirm that the condition like https://lists.apache.org/thread/k5sjldo71gw8w9cwov29tol99ybd894z referring to that's where my understanding ends 😊 |
Note:
|
if the Windows poll always returns EINTR, this would lead to a busy loop. I think you are correct in your read on this. You could try the following patch that will treat EINTR as an error during shutdowns. Index: modules/http2/h2_mplx.c
===================================================================
--- modules/http2/h2_mplx.c (Revision 1921209)
+++ modules/http2/h2_mplx.c (Arbeitskopie)
@@ -1232,9 +1232,15 @@
rv = apr_pollset_poll(m->pollset, timeout >= 0? timeout : -1, &nresults, &results);
H2_MPLX_ENTER_ALWAYS(m);
if (APR_STATUS_IS_EINTR(rv) && m->shutdown) {
+#ifdef WIN32
+ /* See https://github.com/icing/mod_h2/issues/277
+ * WSAPoll seems to always deliver EINTR during server graceful
+ * restarts. Treat this is an error condition */
+#else
if (!m->aborted) {
rv = APR_SUCCESS;
}
+#endif
goto cleanup;
}
} while (APR_STATUS_IS_EINTR(rv)); |
Hi @icing, Thx for the feedback!
diff --git a/mod_http2/h2_mplx.c b/mod_http2/h2_mplx.c
index 71a7431..fc9b81e 100644
--- a/mod_http2/h2_mplx.c
+++ b/mod_http2/h2_mplx.c
@@ -1232,10 +1232,17 @@ static apr_status_t mplx_pollset_poll(h2_mplx *m, apr_interval_time_t timeout,
H2_MPLX_LEAVE(m);
rv = apr_pollset_poll(m->pollset, timeout >= 0? timeout : -1, &nresults, &results);
H2_MPLX_ENTER_ALWAYS(m);
+ ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, m->c1, APLOGNO(10310) H2_MPLX_MSG(m, "loop rv=%d eintr=%d shutdown=%d aborted=%d pcount=%d"),(int)rv,APR_STATUS_IS_EINTR(rv),m->shutdown,m->aborted,m->processing_count);
if (APR_STATUS_IS_EINTR(rv) && m->shutdown) {
+#ifdef WIN32
+ /* See https://github.com/icing/mod_h2/issues/277
+ * WSAPoll seems to always deliver EINTR during server graceful
+ * restarts. Treat this is an error condition */
+#else
if (!m->aborted) {
rv = APR_SUCCESS;
}
+#endif
goto cleanup;
}
} while (APR_STATUS_IS_EINTR(rv));
if other information is needed in this line for debugging, just tell me |
Hi @icing
I have a bug with mod_h2 and "proxyfied" websockets when restarting the service (graceful I suppose) on Windows
This problem reminds me of https://bz.apache.org/bugzilla/show_bug.cgi?id=65180 but is not fully identical.
httpd 2.4.58 self compiled vs17 x64 mod_h2 2.0.26
101 Switching Protocols
for all and I see the exchanges in the console...and to be clear about it...
indeed, log show an infinite loop after graceful restart..
So
H2Upgrade Off
, I directly fall into the infinite loopThe text was updated successfully, but these errors were encountered: