-
Notifications
You must be signed in to change notification settings - Fork 864
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
SQS SendMessageBatchResponse hasFailed method unexpected response (versions 2.21.18+) #4759
Comments
Ugh, |
I tracked it down, the problematic release is |
@mihalyr To make sure the issue is not with Localstack, can you test using the SQS endpoint directly? |
You mean that Localstack is causing the SDK to use a different Java List implementation internally? Idk, but I can check against SQS to see how it works. Were you not able to test it based on the reproducer I provided? |
Now, this is very interesting, it seems that my tests work against SQS, indeed! The thing is that it broke all our integ tests that use Localstack :( I can't easily switch to run these tests on SQS and tracking down all the methods that changed behavior is also not very appealing. So, 2.21.17 works against both SQS and Localstack, but 2.21.18+ doesn't work anymore properly with the same Localstack. Where do you think the problem should be fixed? Localstack maybe doing something different from the SQS service after the protocol change? |
I just made sure that I use the latest Localstack image and still face the same problem. I believe it would be better to close this issue and create a new one for Localstack instead to see if they are able to fix it on their side. For the time being I will stick to the last working version |
|
Describe the bug
Hi, I have just bumped from
2.21.17
to2.21.18
and facing a similar issue in my tests as people reported in #4713I tested that the latest
2.21.40
is also broken the same way.On 2.21.2
On 2.21.40
This does not seem to be a server-side issue (I'm using Localstack) and it is fixed on the older SDK version and broken with the new one. I think the bug is that the new SDK returns an empty
Collections$UnmodifiableRandomAccessList
instance, while the old implementation was correctly returningDefaultSdkAutoConstructList
which is then checked for in the method implementation:Expected Behavior
SendMessageBatchResponse.hasFailed()
used to returnfalse
when there were no failed items when sending the batch in version2.21.17
or older.Current Behavior
SendMessageBatchResponse.hasFailed()
returnstrue
when there were no failed items when sending the batch in version2.21.18
or newer becausefailed
item list changed fromDefaultSdkAutoConstructList
what the method expects to a different instance.Reproduction Steps
Using
2.21.18
or newer including2.21.40
:Possible Solution
SDK should not change behavior between patch versions. The problem seems to be that the SDK somewhere started to return a different List instance for failed items which breaks the
hasFailed
method original implementations. A workaround is to check forisEmpty
on the failed items as suggested by the Javadoc, which is OK, but not expected to have to fix broken usage on a patch release.Additional Information/Context
No response
AWS Java SDK version used
2.21.18 and above including the latest 2.21.40
JDK version used
OpenJDK Runtime Environment Corretto-21.0.1.12.1 (build 21.0.1+12-LTS)
Operating System and version
Fedora 38
The text was updated successfully, but these errors were encountered: