Discussion:
behavior change when enabling HTX (in regtest /connection/b00000.vtc)
PiBa-NL
2018-12-02 23:30:37 UTC
Permalink
Hi List,

When running regtest /connection/b00000.vtc with the added setting below:

defaults

    option http-use-htx

The test no longer completes successfully, is this 'by design' ? It
seems its not closing the server connection? Or at least not logging so,
which i guess is why the log line isn't emitted at the same 'expected' time?

Regards,

PiBa-NL (Pieter)
Willy Tarreau
2018-12-03 03:29:35 UTC
Permalink
Hi Pieter,
Post by PiBa-NL
Hi List,
defaults
    option http-use-htx
The test no longer completes successfully, is this 'by design' ? It seems
its not closing the server connection? Or at least not logging so, which i
guess is why the log line isn't emitted at the same 'expected' time?
It's not expected that the connection is not closed, however since the log
happens at slightly different stages it could be possible that it's just a
matter of event logging. In any case we'll have to have a look.

By the way we've been thinking how to easily run the same tests with and
without HTX. I wanted to support "ifdef" in the config but it's a bit late
now. For the time being, I found that we could do something very ugly like
having something like this in the config :

${HTX} http-use-htx

and set the "HTX" variable to either "option" or "desc" (latter being to
ignore the keyword by making it the proxy's description). With minor
changes to the config parser (dropping leading empty words), we could
have "$NOHTX" option http-use-htx and set "NOHTX" to "no" to disable
it.

Cheers,
Willy
PiBa-NL
2018-12-05 23:36:39 UTC
Permalink
Hi Willy,
Post by Willy Tarreau
Hi Pieter,
Post by PiBa-NL
Hi List,
defaults
    option http-use-htx
The test no longer completes successfully, is this 'by design' ? It seems
its not closing the server connection? Or at least not logging so, which i
guess is why the log line isn't emitted at the same 'expected' time?
It's not expected that the connection is not closed,
After some additional testing I think the connection is and was properly
closed. Just the logging was a bit strange.
Post by Willy Tarreau
however since the log
happens at slightly different stages it could be possible that it's just a
matter of event logging. In any case we'll have to have a look.
Weird additional issue was that adding a 'option htttplog' changed the
number of syslog lines produced. Instead of 2 connect lines, it shows 1
http log line. That is with the 'old' -dev9 version, current master
branch seems to have fixed this already.
Post by Willy Tarreau
By the way we've been thinking how to easily run the same tests with and
without HTX. I wanted to support "ifdef" in the config but it's a bit late
now. For the time being, I found that we could do something very ugly like
${HTX} http-use-htx
and set the "HTX" variable to either "option" or "desc" (latter being to
ignore the keyword by making it the proxy's description). With minor
changes to the config parser (dropping leading empty words), we could
have "$NOHTX" option http-use-htx and set "NOHTX" to "no" to disable
it.
I'm not sure how feasible this is in the end. I like the ability to also
just run a test directly outside of the run-regtests.sh script. And get
the same pass/fail result.
When using such a $NOHTX 'trick' The test would need to always be run
twice with different parameters to perform a 'complete' test of all
haproxy features in the current build. Also what would the minimum
required haproxy version for such a test become, would it be 1.9 or 1.8
which wouldn't know what 'no option http-use-htx' means.? And even then
the specific /connection/b00000.vtc test currently succeeds only with
htx if also the HTTP/1.1 is changed to HTTP/2.0 in the expected syslog
output. Which i'm not sure if it is or isn't a desired effect/change.?.

When testing with 1.6 the /connection/b00000.vtc needs to be run without
threads. And with 1.5 the config would need to change again to not
include fd@ sockets, which seems impossible though as varnishtest
automatically adds a 'admin socket' into the config utilizing such a fd@
socket.

In the end it probably becomes tricky to use 1 'master set' of tests
that can be run against any older version, without duplicating tests or
including some more advanced ifdef constructions as you already
mentioned. Which i think would need to be supported by the 'testing
framework', not by haproxy itself. Maybe 'vtest' will eventually have
such abilities? Or perhaps the vtc test file would need a little
pre-processing, before passing it to varnishtest. Though that doesn't
really make things easier/faster either..
Post by Willy Tarreau
Cheers,
Willy
Regards,

PiBa-NL (Pieter)
Willy Tarreau
2018-12-06 04:34:59 UTC
Permalink
Hi Pieter,
Post by PiBa-NL
Post by Willy Tarreau
Post by PiBa-NL
    option http-use-htx
The test no longer completes successfully, is this 'by design' ? It seems
its not closing the server connection? Or at least not logging so, which i
guess is why the log line isn't emitted at the same 'expected' time?
It's not expected that the connection is not closed,
After some additional testing I think the connection is and was properly
closed. Just the logging was a bit strange.
I've got another report of weird logging that went away with a recent
fix (sorry I don't remember which commit, these days bugs come and go).
Post by PiBa-NL
Post by Willy Tarreau
however since the log
happens at slightly different stages it could be possible that it's just a
matter of event logging. In any case we'll have to have a look.
Weird additional issue was that adding a 'option htttplog' changed the
number of syslog lines produced. Instead of 2 connect lines, it shows 1 http
log line. That is with the 'old' -dev9 version, current master branch seems
to have fixed this already.
I *think* it was the same then.
Post by PiBa-NL
Post by Willy Tarreau
By the way we've been thinking how to easily run the same tests with and
without HTX. I wanted to support "ifdef" in the config but it's a bit late
now. For the time being, I found that we could do something very ugly like
${HTX} http-use-htx
and set the "HTX" variable to either "option" or "desc" (latter being to
ignore the keyword by making it the proxy's description). With minor
changes to the config parser (dropping leading empty words), we could
have "$NOHTX" option http-use-htx and set "NOHTX" to "no" to disable
it.
I'm not sure how feasible this is in the end. I like the ability to also
just run a test directly outside of the run-regtests.sh script. And get the
same pass/fail result.
When using such a $NOHTX 'trick' The test would need to always be run twice
with different parameters to perform a 'complete' test of all haproxy
features in the current build.
Yes I agree. I've also a bit changed my mind on this after discussing
with Olivier and Christopher yesterday. We were discussing about the
tests to add to validate HTTP processing and while discussing about
outgoing H2, I realized that such a configuration cannot exist without
HTX anyway so such a conf would not work, and we'd still need to
duplicate some tests anyway. Thus in the end better keep some partial
duplication for now and later we'll see how to possibly improve this
(e.g. we could imagine having some test generation scripts later if
needed).
Post by PiBa-NL
Also what would the minimum required haproxy
version for such a test become, would it be 1.9 or 1.8 which wouldn't know
what 'no option http-use-htx' means.?
That's the one I wanted to address by using the "description" keyword as
a way to comment out the line, but it's ugly and will not make us move
far enough.
Post by PiBa-NL
And even then the specific
/connection/b00000.vtc test currently succeeds only with htx if also the
HTTP/1.1 is changed to HTTP/2.0 in the expected syslog output.
Good point.
Post by PiBa-NL
Which i'm not sure if it is or isn't a desired effect/change.?.
It's expected that we have the real version in the logs. However without
HTX since H2 is translated to H1 before being processed, we really have
H1 in the logs.
Post by PiBa-NL
When testing with 1.6 the /connection/b00000.vtc needs to be run without
threads. And with 1.5 the config would need to change again to not include
While I value the backwards compatibility which helps us get a bit more
confidence while working on stable branches, we have to keep in mind that
the regtests were not introduced for this but to help developers verify
they didn't break something obvious before committing. So whatever benefit
a test can bring to older version is good and appreciated, but I really
do not want to complicate tests' writing nor maintenance just for the
sake of backwards compatibility, or it will divert them from their
initial purpose.
Post by PiBa-NL
In the end it probably becomes tricky to use 1 'master set' of tests that
can be run against any older version, without duplicating tests or including
some more advanced ifdef constructions as you already mentioned. Which i
think would need to be supported by the 'testing framework', not by haproxy
itself.
I'd really like them for haproxy at least for my own configs : every time
I migrate a server to a new version, I want to test the new features, and
if something breaks I have to roll back and comment out all the stuff I
added. Similarly, sometimes I'm seeing configs with "bind ... process x/y"
that trigger warnings due to nbproc/nbthread not matching. There are a
number of valid use cases for having ifdef in configurations that need
to be regularly modified or that need to adapt to changing versions. That
doesn't mean we can't have that for the tests as well of course!
Post by PiBa-NL
Maybe 'vtest' will eventually have such abilities? Or perhaps the
vtc test file would need a little pre-processing, before passing it to
varnishtest. Though that doesn't really make things easier/faster either..
Indeed!

Cheers,
Willy

Loading...