-
Notifications
You must be signed in to change notification settings - Fork 912
Allowlist known blocking methods from BlockHound #2897
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8ca82d5
Allow-list known blocking methods from BlockHound
bd8c48c
Add change log entry
4275229
Move to service-test-utils module
b953c8b
Remove change log entry
4d365f7
Remove internal annotation (no longer needed for test class)
b4f4ad4
Make service provider public
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...est-utils/src/main/java/software/amazon/awssdk/testutils/service/BlockHoundAllowlist.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.testutils.service; | ||
|
||
import reactor.blockhound.BlockHound; | ||
import reactor.blockhound.integration.BlockHoundIntegration; | ||
|
||
/** | ||
* Implements {@link BlockHoundIntegration} to explicitly allow SDK calls that are known to be blocking. Some calls (with an | ||
* associated tracking issue) may wrongly block, but we allow-list them so that existing integration tests will continue to pass | ||
* and so that we preserve visibility on future regression detection. | ||
* <p> | ||
* https://github.com/reactor/BlockHound/blob/master/docs/custom_integrations.md | ||
*/ | ||
public class BlockHoundAllowlist implements BlockHoundIntegration { | ||
@Override | ||
public void applyTo(BlockHound.Builder builder) { | ||
// https://github.com/aws/aws-sdk-java-v2/issues/2145 | ||
builder.allowBlockingCallsInside( | ||
"software.amazon.awssdk.http.nio.netty.internal.BetterSimpleChannelPool", | ||
"close" | ||
); | ||
|
||
// https://github.com/aws/aws-sdk-java-v2/issues/2360 | ||
builder.allowBlockingCallsInside( | ||
"software.amazon.awssdk.auth.credentials.InstanceProfileCredentialsProvider", | ||
"getToken" | ||
); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...src/main/resources/META-INF/services/reactor.blockhound.integration.BlockHoundIntegration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# A copy of the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0 | ||
# | ||
# or in the "license" file accompanying this file. This file is distributed | ||
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
# express or implied. See the License for the specific language governing | ||
# permissions and limitations under the License. | ||
# | ||
|
||
software.amazon.awssdk.testutils.service.BlockHoundAllowlist | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.