Le 20/11/2018 à 08:36, Frederic Lecaille a écrit :

However that still doesn't work yet (as also already seen by Frederic):

**   c4    0.2 === txreq -req GET -url /3
***  c4    0.2 tx: stream: 1, type: HEADERS (1), flags: 0x05, size: 37
**   c4    0.2 === rxresp
***  h1    0.2 debug|00000007:fe4.accept(000e)=0010 from [::1:13402]
ALPN=<none>
**** h1    0.2 STDOUT poll 0x11
***  c4    0.2 HTTP2 rx EOF (fd:6 read: No error: 0)
---- c4    0.2 could not get frame header
**   c4    0.2 Ending stream 1
***  c4    0.2 closing fd 6
**   c4    0.2 Ending
*    top   0.2 RESETTING after ./PB-TEST/h2-keepalive-backend.vtc
**   h1    0.2 Reset and free h1 haproxy 31909
**   h1    0.2 Wait
**   h1    0.2 Stop HAproxy pid=31909
**   h1    0.2 WAIT4 pid=31909 status=0x008b (user 0.013928 sys 0.000000)
*    h1    0.2 Expected exit: 0x0 signal: 0 core: 0
---- h1    0.2 Bad exit status: 0x008b exit 0x0 signal 11 core 128
*    top   0.2 failure during reset
#    top  TEST ./PB-TEST/h2-keepalive-backend.vtc FAILED (0.169) exit=2

Note that, on my side this crash is always reproducible if we use only
c4 and s4 (after removing all the other c[1-3] and s[1-3] clients and
servers).


Hi,

The H2 is not yet compatible with the HTX for now. So you should never use both in same time. However, this configuration error should be detected during the configuration parsing, to avoid runtime errors. Here is a patch to do so. I'll merge it.

Thanks
--
Christopher Faulet
>From 46eef7144892ddb97fadfa76771092688d3b2e76 Mon Sep 17 00:00:00 2001
From: Christopher Faulet <[email protected]>
Date: Tue, 20 Nov 2018 11:23:52 +0100
Subject: [PATCH] BUG/MINOR: config: Be aware of the HTX during the check of
 mux protocols

Because the HTX is still experimental, we must add special cases during the
configuration check to be sure it is not enabled on a proxy with incompatible
options. Here, for HTX proxies, when a mux protocol is specified on a bind line
or a server line, we must force the HTX mode (PROTO_MODE_HTX).

Concretely, H2 is the only mux protocol that can be forced. And it doesn't yet
support the HTX. So forcing the H2 on an HTX proxy will always fail.
---
 src/cfgparse.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/cfgparse.c b/src/cfgparse.c
index 2eb966377..2c660ab0d 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -3321,6 +3321,10 @@ out_uri_auth_compat:
 		list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) {
 			int mode = (1 << (curproxy->mode == PR_MODE_HTTP));
 
+			/* Special case for HTX because it is still experimental */
+			if (curproxy->options2 & PR_O2_USE_HTX)
+				mode = PROTO_MODE_HTX;
+
 			if (!bind_conf->mux_proto)
 				continue;
 			if (!(bind_conf->mux_proto->mode & mode)) {
@@ -3335,6 +3339,10 @@ out_uri_auth_compat:
 		for (newsrv = curproxy->srv; newsrv; newsrv = newsrv->next) {
 			int mode = (1 << (curproxy->mode == PR_MODE_HTTP));
 
+			/* Special case for HTX because it is still experimental */
+			if (curproxy->options2 & PR_O2_USE_HTX)
+				mode = PROTO_MODE_HTX;
+
 			if (!newsrv->mux_proto)
 				continue;
 			if (!(newsrv->mux_proto->mode & mode)) {
-- 
2.17.2

Reply via email to