Hi List, Willy,

The regtest  /reg-tests/log/b00000.vtc, is failing for me as shown below, and attached:

***  s1    0.0 accepted fd 5 127.0.0.1 29538
**   s1    0.0 === rxreq
---- s1    0.0 HTTP rx failed (fd:5 read: Connection reset by peer)
***  c1    0.0 closing fd 8
**   c1    0.0 Ending
*    top   0.0 RESETTING after ./reg-tests/log/b00000.vtc

This happens because the health-check makes a tcp connection, then disconnects, but s1 server expects a http-request.

So to fix this, i propose to apply 1 out of 3 possible fixes i could imagine, each one does fix the test when executed.

a- use s2 server specifically for the tcp health-check
b- use a option httpchk, and repeat s1 server twice
c- remove the health-check completely.

I think option C is probably the cleanest and most fail-safe way. And am 'pretty sure' that the health-check isn't actually needed to reproduce the original issue. Anyhow health-checks could be a source of random test-failures when the system is really slow it might need 2 checks during a test, and normal varnishtest server's only processes 1 connection unless specified differently, or using a 's0 -dispatch'.

Or on second (fourth? / last) thought, is there a bug somewhere as the tcp-health-check 'should' abort the connection even before the 3way-tcp-handshake is completed? And as such s1 should not see that first connection?? (Is that also possible/valid for a FreeBSD system? Or would that be a linux trick?)

Regards,

PiBa-NL (Pieter)

**** top   0.0 extmacro def 
pwd=/usr/ports/net/haproxy-devel/work/haproxy-eb2bbba
**** top   0.0 extmacro def localhost=127.0.0.1
**** top   0.0 extmacro def bad_backend=127.0.0.1 14768
**** top   0.0 extmacro def bad_ip=192.0.2.255
**** top   0.0 macro def 
testdir=/usr/ports/net/haproxy-devel/work/haproxy-eb2bbba/./reg-tests/log
**** top   0.0 macro def 
tmpdir=/tmp/2018-12-08_21-44-28.0VTEYU/vtc.97431.55aa9ba1
*    top   0.0 TEST ./reg-tests/log/b00000.vtc starting
**   top   0.0 === varnishtest "Wrong ip/port logging"
*    top   0.0 TEST Wrong ip/port logging
**   top   0.0 === feature ignore_unknown_macro
**   top   0.0 === server s1 {
**   s1    0.0 Starting server
**** s1    0.0 macro def s1_addr=127.0.0.1
**** s1    0.0 macro def s1_port=45615
**** s1    0.0 macro def s1_sock=127.0.0.1 45615
*    s1    0.0 Listen on 127.0.0.1 45615
**   top   0.0 === syslog Slg_1 -level notice {
**   Slg_1  0.0 Starting syslog server
**** Slg_1  0.0 macro def Slg_1_addr=127.0.0.1
**** Slg_1  0.0 macro def Slg_1_port=16363
**** Slg_1  0.0 macro def Slg_1_sock=127.0.0.1 16363
*    Slg_1  0.0 Bound on 127.0.0.1 16363
**   s1    0.0 Started on 127.0.0.1 45615
**   top   0.0 === haproxy h1 -conf {
**   Slg_1  0.0 Started on 127.0.0.1 16363 (level: 5)
**   Slg_1  0.0 === recv
**** h1    0.0 macro def h1_cli_sock=::1 58187
**** h1    0.0 macro def h1_cli_addr=::1
**** h1    0.0 macro def h1_cli_port=58187
**** h1    0.0 setenv(cli, 6)
**** h1    0.0 macro def h1_fe_1_sock=::1 33423
**** h1    0.0 macro def h1_fe_1_addr=::1
**** h1    0.0 macro def h1_fe_1_port=33423
**** h1    0.0 setenv(fe_1, 7)
**** h1    0.0 conf|    global
**** h1    0.0 conf|\tstats socket 
/tmp/2018-12-08_21-44-28.0VTEYU/vtc.97431.55aa9ba1/h1/stats.sock level admin 
mode 600
**** h1    0.0 conf|    stats socket "fd@${cli}" level admin
**** h1    0.0 conf|
**** h1    0.0 conf|    global
**** h1    0.0 conf|        log 127.0.0.1:16363 local0
**** h1    0.0 conf|
**** h1    0.0 conf|defaults
**** h1    0.0 conf|    log global
**** h1    0.0 conf|    timeout connect 3000
**** h1    0.0 conf|    timeout client 1
**** h1    0.0 conf|    timeout server  10000
**** h1    0.0 conf|
**** h1    0.0 conf|frontend fe1
**** h1    0.0 conf|    bind "fd@${fe_1}"
**** h1    0.0 conf|    mode tcp
**** h1    0.0 conf|    log-format 
{\"dip\":\"%fi\",\"dport\":\"%fp\",\"c_ip\":\"%ci\",\"c_port\":\"%cp\",\"fe_name\":\"%ft\",\"be_name\":\"%b\",\"s_name\":\"%s\",\"ts\":\"%ts\",\"bytes_read\":\"%B\"}
**** h1    0.0 conf|    default_backend    be_app
**** h1    0.0 conf|
**** h1    0.0 conf|backend be_app
**** h1    0.0 conf|    server app1 127.0.0.1:45615 check
**   h1    0.0 haproxy_start
**** h1    0.0 opt_worker 0 opt_daemon 0 opt_check_mode 0
**** h1    0.0 argv|exec 
/usr/ports/net/haproxy-devel/work/haproxy-eb2bbba/haproxy -d  -f 
/tmp/2018-12-08_21-44-28.0VTEYU/vtc.97431.55aa9ba1/h1/cfg 
**** h1    0.0 XXX 9 @586
***  h1    0.0 PID: 97435
**** h1    0.0 macro def h1_pid=97435
**** h1    0.0 macro def 
h1_name=/tmp/2018-12-08_21-44-28.0VTEYU/vtc.97431.55aa9ba1/h1
**   top   0.0 === client c1 -connect ${h1_fe_1_sock} {
**   c1    0.0 Starting client
**   c1    0.0 Waiting for client
***  c1    0.0 Connect to ::1 33423
***  c1    0.0 connected fd 8 from ::1 39965 to ::1 33423
**   c1    0.0 === txreq -url "/"
**** c1    0.0 txreq|GET / HTTP/1.1\r
**** c1    0.0 txreq|Host: 127.0.0.1\r
**** c1    0.0 txreq|\r
**   c1    0.0 === delay 0.02
***  c1    0.0 delaying 0.02 second(s)
***  h1    0.0 debug|Note: setting global.maxconn to 2000.
***  h1    0.0 debug|Available polling systems :
***  h1    0.0 debug|     kqueue : pref=300, 
***  h1    0.0 debug| test result OK
***  h1    0.0 debug|       poll : pref=200,  test result OK
***  h1    0.0 debug|     select : pref=150,  test result FAILED
***  h1    0.0 debug|Total: 3 (2 usable), will use kqueue.
***  h1    0.0 debug|
***  h1    0.0 debug|Available filters :
***  h1    0.0 debug|\t[SPOE] spoe
***  h1    0.0 debug|\t[COMP] compression
***  h1    0.0 debug|\t[TRACE] trace
***  h1    0.0 debug|Using kqueue() as the polling mechanism.
**** Slg_1  0.0 syslog|<133>Dec  8 21:44:29 haproxy[97435]: Proxy fe1 started.
**   Slg_1  0.0 === recv
**** Slg_1  0.0 syslog|<133>Dec  8 21:44:29 haproxy[97435]: Proxy be_app 
started.
**   Slg_1  0.0 === recv info
***  h1    0.0 debug|00000000:fe1.accept(0007)=000c from [::1:39965] ALPN=<none>
***  s1    0.0 accepted fd 5 127.0.0.1 29538
**   s1    0.0 === rxreq
---- s1    0.0 HTTP rx failed (fd:5 read: Connection reset by peer)
***  c1    0.0 closing fd 8
**   c1    0.0 Ending
*    top   0.0 RESETTING after ./reg-tests/log/b00000.vtc
**   h1    0.0 Reset and free h1 haproxy 97435
**   h1    0.0 Wait
**   h1    0.0 Stop HAproxy pid=97435
**** h1    0.0 Kill(2)=0: No error: 0
**** h1    0.0 STDOUT poll 0x11
**   h1    0.1 WAIT4 pid=97435 status=0x0002 (user 0.000000 sys 0.007500)
**   s1    0.1 Waiting for server (3/-1)
**   Slg_1  0.1 Waiting for syslog server (4)
*    top   0.1 TEST ./reg-tests/log/b00000.vtc FAILED

From d64629583469aa308767a4da05e93200794c0e81 Mon Sep 17 00:00:00 2001
From: PiBa-NL <[email protected]>
Date: Sat, 8 Dec 2018 21:08:35 +0100
Subject: [PATCH] REGTEST/MINOR: fix health-check that can make the test fail

The reg-tests/log/b00000.vtc performs a TCP-health-check that now connects to 
the s2 server and then disconnects without making a http-request.
---
 reg-tests/log/b00000.vtc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/reg-tests/log/b00000.vtc b/reg-tests/log/b00000.vtc
index 99a81cd9..20784ba2 100644
--- a/reg-tests/log/b00000.vtc
+++ b/reg-tests/log/b00000.vtc
@@ -26,6 +26,9 @@ server s1 {
     txresp
 } -start
 
+server s2 {
+} -start
+
 syslog Slg_1 -level notice {
     recv
     recv
@@ -50,7 +53,7 @@ frontend fe1
     default_backend    be_app
 
 backend be_app
-    server app1 ${s1_addr}:${s1_port} check
+    server app1 ${s1_addr}:${s1_port} check port ${s2_port}
 } -start
 
 client c1 -connect ${h1_fe_1_sock} {
-- 
2.18.0.windows.1

From 30d4ee4fedeef017ca2a30cebc35e95a7bc491f1 Mon Sep 17 00:00:00 2001
From: PiBa-NL <[email protected]>
Date: Sat, 8 Dec 2018 21:16:31 +0100
Subject: [PATCH] REGTEST/MINOR: fix health-check that can make the test fail

The reg-tests/log/b00000.vtc should perform a HTTP-health-check and the s1 
server should allow 2 requests, one by the health-check, the other the actual 
test request.
---
 reg-tests/log/b00000.vtc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/reg-tests/log/b00000.vtc b/reg-tests/log/b00000.vtc
index 99a81cd9..2682b1da 100644
--- a/reg-tests/log/b00000.vtc
+++ b/reg-tests/log/b00000.vtc
@@ -24,7 +24,7 @@ feature ignore_unknown_macro
 server s1 {
     rxreq
     txresp
-} -start
+} -repeat 2 -start
 
 syslog Slg_1 -level notice {
     recv
@@ -50,6 +50,7 @@ frontend fe1
     default_backend    be_app
 
 backend be_app
+    option httpchk
     server app1 ${s1_addr}:${s1_port} check
 } -start
 
-- 
2.18.0.windows.1

From 91a0938358ca20f7e1a513d7fff627c0f7dd3dde Mon Sep 17 00:00:00 2001
From: PiBa-NL <[email protected]>
Date: Sat, 8 Dec 2018 21:36:55 +0100
Subject: [PATCH] REGTEST/MINOR: remove health-check that can make the test
 fail

The reg-tests/log/b00000.vtc should not try to perform a health-check of server 
s1 as it only allows 1 request/connection
---
 reg-tests/log/b00000.vtc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/reg-tests/log/b00000.vtc b/reg-tests/log/b00000.vtc
index 99a81cd9..53387048 100644
--- a/reg-tests/log/b00000.vtc
+++ b/reg-tests/log/b00000.vtc
@@ -50,7 +50,7 @@ frontend fe1
     default_backend    be_app
 
 backend be_app
-    server app1 ${s1_addr}:${s1_port} check
+    server app1 ${s1_addr}:${s1_port}
 } -start
 
 client c1 -connect ${h1_fe_1_sock} {
-- 
2.18.0.windows.1

Reply via email to