Skip to content

Fix blocking in ServletOAuth2AuthorizedClientExchangeFilterFunction #7037

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

Conversation

jgrandja
Copy link
Contributor

@jgrandja jgrandja commented Jun 25, 2019

@jgrandja jgrandja requested a review from rwinch June 25, 2019 14:09
// which is a blocking I/O and therefore triggers BlockHound to error.
// The following code forces the initialization of the cache, which ultimately calls
// 'com.fasterxml.jackson.databind.DeserializationContext.hasValueDeserializerFor()'.
new MappingJackson2HttpMessageConverter().canRead(
Copy link
Member

Choose a reason for hiding this comment

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

At minimum this could be simplified to Map.class.getPackage();

@jgrandja jgrandja force-pushed the gh-6589-oauth2-client-non-block branch from 55396c8 to 70df9b5 Compare July 25, 2019 13:52
@jgrandja jgrandja self-assigned this Jul 25, 2019
@jgrandja jgrandja added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: bug A general bug labels Jul 25, 2019
@jgrandja jgrandja added this to the 5.2.0.M4 milestone Jul 25, 2019
// it attempts to java.lang.Package.loadManifest() which is blocking I/O and triggers BlockHound to error.
// The following code forces the loading of the manifest.
// NOTE: This is an issue with JDK 8. It's been tested on JDK 10 and works fine w/o this workaround.
Class.class.getPackage();
Copy link

Choose a reason for hiding this comment

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

Copy link
Member

@rwinch rwinch Aug 5, 2019

Choose a reason for hiding this comment

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

@bsideup I'm curious...It does block, so why would we whitelist it?

@jgrandja
Copy link
Contributor Author

Merged via 4ca9e15

@jgrandja jgrandja closed this Jul 26, 2019
@jgrandja jgrandja deleted the gh-6589-oauth2-client-non-block branch July 26, 2019 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure ServletOAuth2AuthorizedClientExchangeFilterFunction is non-blocking
3 participants