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

http: split strict_1xx_and_204_response_headers into two settings #15880

Merged
merged 5 commits into from
Apr 19, 2021

Conversation

tbarrella
Copy link
Contributor

@tbarrella tbarrella commented Apr 7, 2021

Commit Message:

http: split strict_1xx_and_204_response_headers into two settings

Signed-off-by: Taylor Barrella [email protected]

Additional Description:
Risk Level: Low
Testing: unit
Docs Changes: N/A
Release Notes: added minor behavior change
Runtime guard: replaced strict_1xx_and_204_response_headers with require_strict_1xx_and_204_response_headers and send_strict_1xx_and_204_response_headers
Fixes #13868

@tbarrella
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15880 (comment) was created by @tbarrella.

see: more, trace.

Copy link
Contributor

@lambdai lambdai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM. Thanks!

Question: If accept_strict_1xx_and_204_response_headers == false and send_strict_1xx_and_204_response_headers == true
Is TE stripped in downstream response when the upstream response contains TE?

It's not clear to me whether the downstream TE is always decided by send_strict_1xx_and_204_response_headers regardless the upstream response contains TE or not.

Copy link
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG overall, thanks so much for picking this one up!

Two thoughts. Do you think it should be strict_accept since we're making accepting strict, it's not that we're accepting strict headers (which I think we would either way?)

I think it's worth an integration test making sure that new-accept works with old-send, to make sure this actually addresses the problem.

@tbarrella
Copy link
Contributor Author

Do you think it should be strict_accept since we're making accepting strict, it's not that we're accepting strict headers (which I think we would either way?)

That's more grammatical yeah, although I think the flags should be consistent. So I can switch that as long as it's ok to switch the other to strict_send. Also, feel like I might as well use strict_allow because that seems a little better...

@alyssawilk
Copy link
Contributor

Hm, I feel like send_strict and strict_accept makes sense but I hear you about wanting to keep them parallel. How about send_strict and require_strict so you can keep the ordering the same but the meaning clear?

Signed-off-by: Taylor Barrella <[email protected]>
@tbarrella
Copy link
Contributor Author

Question: If accept_strict_1xx_and_204_response_headers == false and send_strict_1xx_and_204_response_headers == true
Is TE stripped in downstream response when the upstream response contains TE?

I think so based on this comment.

I think it's worth an integration test making sure that new-accept works with old-send, to make sure this actually addresses the problem.

Do you mean require_strict_1xx_and_204_response_headers = false and send_strict_1xx_and_204_response_headers = true (what's desired in istio/istio#28450 (comment))? Looking more, I'm not sure how valuable it would be to add an integration test for this. For example, I could duplicate the BidirectionalChunkedData test with require_strict_1xx_and_204_response_headers = false (it passes, and also fails with send_strict_1xx_and_204_response_headers = false instead) but the only real place this is used is here. I think these paths are effectively covered by the tests in codec_impl_test.cc.

@tbarrella
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15880 (comment) was created by @tbarrella.

see: more, trace.

@alyssawilk
Copy link
Contributor

Ah, is what you're saying that the codec tests, while looking the same, are actually testing the case which failed before, of a mix of old and new style headers, so are validating the bug fix despite not being end to end? If so I think I'm good :-)

alyssawilk
alyssawilk previously approved these changes Apr 15, 2021
@tbarrella
Copy link
Contributor Author

Yeah, specifically the second half of 204ResponseWithContentLength0 is a situation that could result from this combination of flags. Thank you!

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15880 (comment) was created by @tbarrella.

see: more, trace.

@tbarrella
Copy link
Contributor Author

Hi @snowp, @alyssawilk said this is

going to need a main merge around 12PDT when the new release is created and 1.19 notes are created. ... I've tagged snowp for second pass, and to do the merge while I'm out so you can ping him once it's re-ready.

Did I tag you too late? Which release will this be going into?

@tbarrella
Copy link
Contributor Author

Hm, the format check failure looks unrelated to my change

@snowp
Copy link
Contributor

snowp commented Apr 15, 2021

This will go out with 1.19 as is. Can you try merging main and see it that helps resolve the format issue? It does seem unrelated to this code as you say

@tbarrella
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #15880 (comment) was created by @tbarrella.

see: more, trace.

Copy link
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@snowp snowp merged commit 751be72 into envoyproxy:main Apr 19, 2021
@tbarrella tbarrella deleted the te-headers branch April 19, 2021 18:11
gokulnair pushed a commit to gokulnair/envoy that referenced this pull request May 6, 2021
@jojofeng
Copy link

jojofeng commented May 19, 2021

Hi, I'm new to envoy so I apologize for the naive question, but how do I actually configure these flags? I would like to set require_strict_1xx_and_204_headers to False in my configuration. Do I pass it from the command line? Or do I need to add something to my YAML config?

EDIT: I believe I can add it by configuring a static_layer

@rbalaraman-c
Copy link

rbalaraman-c commented Aug 4, 2021

Same as @jojofeng (above), I would also like to know how to configure these flags.
I believe I can do it by calling "POST /runtime_modify" on the envoy sidecar admin interface. But what is a permanent way of configuring them?

@tbarrella
Copy link
Contributor Author

@rbalaraman-c You can add a static_layer layer to layered_runtime.layers in bootstrap config. The static layer should be a {runtime flag: value} map.

@jojofeng
Copy link

jojofeng commented Aug 4, 2021

@rbalaraman-c this is the exact configuration block i use 😄 i hope it helps!

layered_runtime:
  layers:
    - name: base
      static_layer:
        envoy.reloadable_features.require_strict_1xx_and_204_response_headers: false

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

Successfully merging this pull request may close these issues.

[feature request] Fault-in-standard-out option on TE header at 1xx and 204
6 participants