Skip to content
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

Varnishtop 6 does not report RespUnset tags #3527

Closed
yched opened this issue Feb 19, 2021 · 8 comments
Closed

Varnishtop 6 does not report RespUnset tags #3527

yched opened this issue Feb 19, 2021 · 8 comments
Assignees

Comments

@yched
Copy link

yched commented Feb 19, 2021

Expected Behavior

varnishtop should show RespUnset tags, just like any other VSL tag
that's the case in 5.2

for instance, when http_gzip_support=on and serving zipped beresp to clients with no Accept-Encoding:gzip,
varnishtop 5.2 does show

   218.15 RespHeader     Content-Encoding: gzip
   218.15 RespUnset      Content-Encoding: gzip

Current Behavior

varnishtop 6 (tested with 6.0.7) does not show any RespUnset tag

in the "serving zipped beresp to no-gzip reqs" case mentioned above,
varnishtop 6.0.7 only shows

   527.12 RespHeader     Content-Encoding: gzip

without the corresponding RespUnset (which is indeed listed by varnishlog when looking at individual request logs)

@nigoroll
Copy link
Member

nigoroll commented Feb 19, 2021

first look:
Because of the 0, 0,, Unset is flagged as "not used in either req or resp"

SLTH(Unset, HTTP_HDR_UNSET, 0, 0, "unset header",

So SLT_F_UNUSED gets added here
SLTM(Resp##tag, (resp ? 0 : SLT_F_UNUSED), "Client response " sdesc, \

which is skipped in varnishtop here
if (VSL_tagflags[tag])

VSL_tagflags was added in 63807dd and I think at that point the check in varnishtop (and maybe elsewhere) should have been limited to binary and unsafe records?

@nigoroll
Copy link
Member

nigoroll commented Feb 19, 2021

Or should RespUnset not be flagged SLT_F_UNUSED to begin with?

@yched
Copy link
Author

yched commented Feb 19, 2021

This is largely above my head, to be fair, but :
is RespUnset baing flagged SLT_F_UNUSED also related to the (sometimes puzzling IMO) behavior that
varnishncsa still displays header values even if they have in fact been unset ?

e.g :

set resp.http.X-My-Header = 'not-actually-sent';
unset resp.http.X-My-Header;

varnishncsa -f "%{X-My-Header}o" --> "not-actually-sent" ?

(sorry if this is something else entirely...)

@nigoroll
Copy link
Member

FTR Unsetadded to vcl_tags_http.h a8e79f6
SLT_F_UNUSED introduced in 6725221

@nigoroll
Copy link
Member

@yched my remarks are for coordination with fellow developers.
The varnishncsa issue would somehow be related, but a different bug. Please open a new ticket.

@yched
Copy link
Author

yched commented Feb 19, 2021

Sure, I know you didn't expect me to answer that 😁
varnishncsa : ok, will do

@nigoroll
Copy link
Member

after input from @mbgrydeland on IRC this one should be easy to fix:

(13:30:57) martin: slink: The SLT_F_UNUSED is just an artifact I think, in order to not list out and document (in the vsl2rst binary) some of the generated combinations that are impossible
(13:32:00) martin: comes as a result of how the tbl/vsl_tags_http.h include table is used
(14:41:53) slink: martin: ok cool, so in fact it should not be set for tags which we do emit, right?

@mbgrydeland
Copy link
Contributor

(14:41:53) slink: martin: ok cool, so in fact it should not be set for tags which we do emit, right?

I'm not sure I understand the question.

As I unserstand it, the only defined effect of SLT_F_UNUSED is to skip it when creating the RST doc output in vsl2rst. The matrix of SLT_F_{Req,Resp,Obj,Bereq,Beresp}{Method,URL,Status,...} becomes quite large, and would bloat the vsl2rst output with a lot of duplicate and non-useful information. So this trick with the flag was introduced to limit that output.

VSL_tagflags was added in 63807dd and I think at that point the check in varnishtop (and maybe elsewhere) should have been limited to binary and unsafe records?

I think that is a correct analysis. Assuming that any tag flag is the same and any set should skip it is wrong.

@nigoroll nigoroll self-assigned this Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants