Skip to content

Commit 303ca68

Browse files
committedMar 24, 2025
* mod_proxy_http2: revert r1912193 for detecting broken backend connections
as this interferes with backend selection who a node is unresponsive. PR69624. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924554 13f79535-47bb-0310-9956-ffa450edef68
1 parent ffeacdc commit 303ca68

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed
 

‎changes-entries/pr69624.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* mod_proxy_http2: revert r1912193 for detecting broken backend connections
2+
as this interferes with backend selection who a node is unresponsive.
3+
PR69624.

‎modules/http2/h2_proxy_session.c

+1-11
Original file line numberDiff line numberDiff line change
@@ -1681,17 +1681,7 @@ static int done_iter(void *udata, void *val)
16811681
h2_proxy_stream *stream = val;
16821682
int touched = (stream->data_sent || stream->data_received ||
16831683
stream->id <= ctx->session->last_stream_id);
1684-
if (touched && stream->output) {
1685-
apr_bucket *b = ap_bucket_error_create(HTTP_BAD_GATEWAY, NULL,
1686-
stream->r->pool,
1687-
stream->cfront->bucket_alloc);
1688-
APR_BRIGADE_INSERT_TAIL(stream->output, b);
1689-
b = apr_bucket_eos_create(stream->cfront->bucket_alloc);
1690-
APR_BRIGADE_INSERT_TAIL(stream->output, b);
1691-
ap_pass_brigade(stream->r->output_filters, stream->output);
1692-
}
1693-
ctx->done(ctx->session, stream->r, APR_ECONNABORTED, touched,
1694-
stream->error_code);
1684+
ctx->done(ctx->session, stream->r, APR_ECONNABORTED, touched, stream->error_code);
16951685
return 1;
16961686
}
16971687

‎modules/http2/h2_version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
* @macro
2828
* Version number of the http2 module as c string
2929
*/
30-
#define MOD_HTTP2_VERSION "2.0.30"
30+
#define MOD_HTTP2_VERSION "2.0.31-git"
3131

3232
/**
3333
* @macro
3434
* Numerical representation of the version number of the http2 module
3535
* release. This is a 24 bit number with 8 bits for major number, 8 bits
3636
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
3737
*/
38-
#define MOD_HTTP2_VERSION_NUM 0x02001e
38+
#define MOD_HTTP2_VERSION_NUM 0x02001f
3939

4040

4141
#endif /* mod_h2_h2_version_h */

‎modules/http2/mod_proxy_http2.c

+3-9
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typedef struct h2_proxy_ctx {
6565
unsigned is_ssl : 1;
6666

6767
request_rec *r; /* the request processed in this ctx */
68-
int r_status; /* status of request work */
68+
apr_status_t r_status; /* status of request work */
6969
int r_done; /* request was processed, not necessarily successfully */
7070
int r_may_retry; /* request may be retried */
7171
int has_reusable_session; /* http2 session is live and clean */
@@ -414,7 +414,7 @@ static int proxy_http2_handler(request_rec *r,
414414
"setup new connection: is_ssl=%d %s %s %s",
415415
ctx->p_conn->is_ssl, ctx->p_conn->ssl_hostname,
416416
locurl, ctx->p_conn->hostname);
417-
ctx->r_status = ap_map_http_request_error(status, HTTP_SERVICE_UNAVAILABLE);
417+
ctx->r_status = status;
418418
goto cleanup;
419419
}
420420

@@ -428,7 +428,7 @@ static int proxy_http2_handler(request_rec *r,
428428
if (ctx->cfront->aborted) goto cleanup;
429429
status = ctx_run(ctx);
430430

431-
if (ctx->r_status != OK && ctx->r_may_retry && !ctx->cfront->aborted) {
431+
if (ctx->r_status != APR_SUCCESS && ctx->r_may_retry && !ctx->cfront->aborted) {
432432
/* Not successfully processed, but may retry, tear down old conn and start over */
433433
if (ctx->p_conn) {
434434
ctx->p_conn->close = 1;
@@ -464,12 +464,6 @@ static int proxy_http2_handler(request_rec *r,
464464
ap_set_module_config(ctx->cfront->conn_config, &proxy_http2_module, NULL);
465465
ap_log_cerror(APLOG_MARK, APLOG_DEBUG, status, ctx->cfront,
466466
APLOGNO(03377) "leaving handler");
467-
if (ctx->r_status != OK) {
468-
ap_die(ctx->r_status, r);
469-
}
470-
else if (status != APR_SUCCESS) {
471-
ap_die(ap_map_http_request_error(status, HTTP_SERVICE_UNAVAILABLE), r);
472-
}
473467
return ctx->r_status;
474468
}
475469

0 commit comments

Comments
 (0)