-
Notifications
You must be signed in to change notification settings - Fork 791
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
STS not on class path when using parallel stream #2123
Comments
Thank you for reporting the issue! I think we should use class loader instead of the thread context loader. We already have the |
Hi @BartXZX
or it would be of great help if you could provide all dependencies related to software.amazon.awssdk |
Hi @joviegas, we use gradle. I have the following dependencies.
Also, I removed all the parallel streams that used the SDK from the codebase and the issue goes away. STS was not found:
And right below that in our logs, STS was found:
|
Is there a preview build somewhere for 26, or should I just wait for it to be released? |
Nevermind, I see it's already in 25 :-) Of course, it was an issue we saw 'sometimes' but usually we had a 50/50 chance to see it on startup. Thank you for the quick response! |
Marking this to auto close soon, feel free to reach out if the issue persists after the fix. |
I've also hit the bug, and can confirm that the fix is working. |
Thank you so much @casperbiering and @BartXZX . |
…02a67e4b7 Pull request: release <- staging/e474196e-4969-4cda-932d-39a02a67e4b7
Running EcrClient.listImagesPaginator() in a Collection.parallelStream() using Spring Boot sometimes results in WebIdentityCredentialsUtils.factory() not finding STS on its class path.
Describe the issue
Sometimes when I execute the above I get the error message: "To use web identity tokens, the 'sts' service module must be on the class path.". I know that parallel streams delegates work to the ForkJoin common pool, and it seems that sometimes some threads from this pool might have a class loader that does not have STS on its path. (Maybe because of Spring? I noticed that the loader called "app" does not have STS)
Is there a reason you guys are using Thread.currentThread().getContextClassLoader(), instead of Object.getClass().getClassLoader() in the WebIdentityCredentialsUtils class?
I admit I know little about class loaders and how you use them, but I cannot use parallelStream() reliably at the moment. Or do you advise against using parallelStream at all?
Not filing as bug, since it might be intended behaviour.
Steps to Reproduce
I am listing docker images from multiple repositories in parallel.
Current Behavior
I get the message "To use web identity tokens, the 'sts' service module must be on the class path." instead of it finding STS and using the token credentials.
Your Environment
The text was updated successfully, but these errors were encountered: