-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Allow passing ALPN next protocols down to connect services. Fixes #4466. #9920
Conversation
b594e02
to
5b32c2a
Compare
5b32c2a
to
626593f
Compare
626593f
to
01f058c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the super quick work!
I realise you're still working on this as the proxy.go change isn't here yet but some minor early feedback before I'm out for the day.
I agree the pointer to string slice is a little odd. It seems like that can just be changed though right? Slices in go are already "pointer" types that can be nil without explicitly pointing to them. Was there something I missed that made it tricky to just use a slice?
Well not exactly,
I do not "know" go, I will read up on slices and try to get it to work. Thanks for the early feedback, I posted the PR early on because I didn't want to go into the wrong direction… |
01f058c
to
ed50ff5
Compare
ed50ff5
to
85c27c8
Compare
85c27c8
to
af2165c
Compare
af2165c
to
efe90d5
Compare
It would be great if one could copy the CI failure out of circle-ci for me. I am not going to login to circle ci when it wants access to my private repos… Locally
but that is unrelated to my changes. |
Hey @apollo13 - Here's the errors I collected. The first error doesn't provide any feedback. The second is a bit more clear. # TestACLEndpoint_Login_with_TokenLocality
=== CONT TestACLEndpoint_Login_with_TokenLocality At the start of the second test, we have:
And then a bit later on:
Hope this helps! |
@jsosulska Thanks, can't say it helps much though. I cannot imagine that those are triggered by my changes and cannot reproduce it locally either :/ (I removed the linting check so I can actually run |
@apollo13 yes those CI failures appear to be unrelated. I'll double check again before we merge of course but we do sadly still have flaky tests some times. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apollo13 thanks so much for getting this change in so quickly!
I think this is pretty close to mergeable. The one thing missing as the coverage checker pointed out is that we there are no tests that validate the new behaviour. It's a small plumbing change and a little awkward to test but it would be ideal to have tests to ensure we don't regress this again.
I think the simplest approach would be to just test end-to-end in the proxy package - perhaps with another test along side TestPublicListener
in listener.go
. That test didn't fail before I think because it's only running a TCP test server.
If we had a second test (TestPublicListenerHTTP
?) that used httptest.Server
as the "application", ran the proxy as in the existing test but then used svc.HTTPClient
to connect to it, I think that should reproduce the failure outlined in the original ticket without this fix. That would then be a good test that the built in proxy is no longer advertising h2 and would still be relatively simpler/cheap to run.
Do you think that's something you'd be able to look into to get this landed?
Thanks again for your effort here!
d2b3c37
to
2611fa7
Compare
@banks I did adjust the existing proxy e2e test to verify that ALPN was not used. I also double checked this by "reverting" parts of my fix so that the proxy would accept h2 via ALPN. Since the changes are rather minimal I just adjusted the test, a new one would have been a 90% duplication. I did not manage to do the listener test. This is mainly because those use |
2611fa7
to
58dbeeb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job @apollo13, this looks great to me.
I had a minor suggestion on the test comment wording if you agree and want to use that suggestion or modify it yourself somehow I'll hold of merging it until you do, but it's a nitpick so I'll approve now anyway!
Co-authored-by: Paul Banks <[email protected]>
Jupp, the wording change looks good. |
Thanks so much for getting this fix in @apollo13! |
This will be part of Consul 1.10 which will be released in roughly a month or two. |
@banks This should cover the technical aspects of the PR. I am not to happy with the pointer to the nextProto array, but I am not sure how we could pass the default nicely otherwise…