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

Make sure http2 is not tried #1671

Merged
merged 2 commits into from
Aug 1, 2019
Merged

Make sure http2 is not tried #1671

merged 2 commits into from
Aug 1, 2019

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jul 29, 2019

This is prevented because it breaks the mock-webserver in Java 11

The actual problem with mock-webserver seems to be an okhttp issue, but we can easily work around it here by ensuring that http2 is never tried (kubernetes-api server isn't http2 anyway so there no point in even attempting to use http2).

This is not a problem in Java 8 because the default installations of Java 8 don't support http2

@centos-ci
Copy link

Can one of the admins verify this patch?

@geoand geoand changed the title Make sure http2 is not tried WIP: Make sure http2 is not tried Jul 29, 2019
@geoand geoand changed the title WIP: Make sure http2 is not tried Make sure http2 is not tried Jul 29, 2019
@iocanel iocanel self-requested a review July 29, 2019 17:37
Copy link
Member

@iocanel iocanel left a comment

Choose a reason for hiding this comment

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

It somehow feels wrong, to disable something, just because it breaks a testing tool or framework.

I would conditionally disable it, when its used along with the mockwebserver.
The wrapper objects that do create the mock server for Kubernetes and Openshift are also responsible for initializing the client instance. So, it should be trivial to use that option there.

AFAIK, you can pass an instance of the Okhttp to the client constructor, so we could use it for this purpose.

@geoand
Copy link
Contributor Author

geoand commented Jul 29, 2019

How would we conditionally disable it?

As for the other instances, we could make the change to the other uses of OkHttpClient.Builder.

@iocanel
Copy link
Member

iocanel commented Jul 29, 2019

Repeat for all kinds of mock servers we provide.

@geoand
Copy link
Contributor Author

geoand commented Jul 29, 2019

Thanks for the pointers! I'll update the PR tomorrow hopefully

@geoand
Copy link
Contributor Author

geoand commented Jul 30, 2019

@iocanel it seems like limiting this to only clients from the mock is not enough.

For instance in SCK there is a client being by the framework itself. Should we perhaps add a value to Config that would be used to exclude http2 (HttpClientUtils would need to take this property into account obviously)?
That way just setting a system property would be enough to make all clients work.

WDYT?

@iocanel
Copy link
Member

iocanel commented Jul 30, 2019 via email

@geoand
Copy link
Contributor Author

geoand commented Jul 30, 2019

The issue is limited to the mockserver, but it manifests itself in SCK.
Basically when any of the clients tries to establish a connection and http2 is checked, the mockserver seems to fail completely.

This is needed in Java 11 because is breaks the mock-webservr
@geoand
Copy link
Contributor Author

geoand commented Jul 30, 2019

@iocanel PR updated

@iocanel iocanel self-requested a review July 30, 2019 08:07
Copy link
Member

@iocanel iocanel left a comment

Choose a reason for hiding this comment

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

This pull request allows, disabling http2 for user-managed clients which is great.

For mock server managed clients, http2 can only be indirectly disabled using system properties.

This either needs to be somehow documented or needs to be the default (since we know that the mockwebserver doesn't currently support http2).

@geoand
Copy link
Contributor Author

geoand commented Jul 30, 2019

Great point. I'll do tha latter if that's OK with you .

I had initially fixed the configuration for the mock, but for some stupid reason I though it would be better to remove it :(

@geoand
Copy link
Contributor Author

geoand commented Jul 30, 2019

@iocanel PR updated again

@geoand
Copy link
Contributor Author

geoand commented Jul 30, 2019

SCK tested with this PR (and adding the new property to the tests) and all tests now pass with Java 11

@geoand
Copy link
Contributor Author

geoand commented Jul 30, 2019

@iocanel any idea why test and license-check CI jobs seem to be stuck?

@rohanKanojia
Copy link
Member

ok to test

@rohanKanojia
Copy link
Member

we need to whitelist PRs on fabric8 ci

@geoand
Copy link
Contributor Author

geoand commented Jul 30, 2019

thanks @rohanKanojia !

@iocanel
Copy link
Member

iocanel commented Jul 30, 2019

add to whitelist

@geoand
Copy link
Contributor Author

geoand commented Jul 30, 2019

CI is green 🎉

@rohanKanojia
Copy link
Member

[merge]

@fusesource-ci fusesource-ci merged commit 171d8ba into fabric8io:master Aug 1, 2019
@geoand geoand deleted the http2 branch August 21, 2019 11:57
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.

None yet

6 participants