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

ConcurrentModificationException #53

Closed
472574155 opened this issue Oct 24, 2018 · 8 comments
Closed

ConcurrentModificationException #53

472574155 opened this issue Oct 24, 2018 · 8 comments
Assignees
Labels
bug Something isn't working pending-response Issue is pending response from the issue requestor

Comments

@472574155
Copy link

Describe the bug
When multiSubscription using, unexpectly exception happened.

To Reproduce
Steps to reproduce the behavior:
When net changed, easily happened

Expected behavior
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:851)
at java.util.HashMap$KeyIterator.next(HashMap.java:885)
at com.amazonaws.mobileconnectors.appsync.subscription.RealSubscriptionManager$1.onError(RealSubscriptionManager.java:196)
at com.amazonaws.mobileconnectors.appsync.subscription.mqtt.MqttSubscriptionClient$1.onFailure(MqttSubscriptionClient.java:85)
at org.eclipse.paho.android.service.MqttTokenAndroid.notifyFailure(MqttTokenAndroid.java:146)
at org.eclipse.paho.android.service.MqttAndroidClient.simpleAction(MqttAndroidClient.java:1501)
at org.eclipse.paho.android.service.MqttAndroidClient.connectAction(MqttAndroidClient.java:1439)
at org.eclipse.paho.android.service.MqttAndroidClient.onReceive(MqttAndroidClient.java:1368)
at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:297)
at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46)
at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:116)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6242)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

Environment(please complete the following information):

  • AppSync SDK Version: [2.6.+]

Device Information (please complete the following information):

  • Device: SHAPE AQUOS SH-M05
  • Android Version: [Nougat 7.1.2]
@frankmuellr frankmuellr added AppSync bug Something isn't working labels Oct 24, 2018
@scb01
Copy link
Contributor

scb01 commented Oct 25, 2018

@472574155

Sorry to hear that you are running into issues. Can you confirm that you are on the latest version of the SDK (2.6.26)? The latest version contains bug fixes for multiple subscriptions - my inspection of the stacktrace is leading me to believe that you may be on an older rev of the SDK. Line 196 of the latest RealSubscriptionManager code is now

If you are on an older version, can you upgrade and let us know it goes.

@scb01 scb01 added question General question pending-response Issue is pending response from the issue requestor and removed bug Something isn't working labels Oct 25, 2018
@472574155
Copy link
Author

@cbommas

Thanks for answer. The reason is that maven is not the lastest version.

classpath 'com.amazonaws:aws-android-sdk-appsync-gradle-plugin:2.6.+'

apply plugin: 'com.amazonaws.appsync'
implementation 'com.amazonaws:aws-android-sdk-appsync:2.6.26'

When using gradle to import, code is not the lastest!
Maven is not the lastest version.

Maven url:http://central.maven.org/maven2/com/amazonaws/aws-android-sdk-appsync/2.6.26/aws-android-sdk-appsync-2.6.26-sources.jar

@scb01
Copy link
Contributor

scb01 commented Oct 29, 2018

@472574155
I double checked Maven and tried to reproduce the error, however I wasn't able to.
Can you share your build.gradle file?

My build.gradle contains

      implementation "com.amazonaws:aws-android-sdk-appsync-gradle-plugin:2.6.+"
      implementation "com.amazonaws:aws-android-sdk-appsync:2.6.+"

and this pulls down the latest version when I do a gradle sync.
Also, please do let me know if you are still experiencing the issue with the latest version.

@472574155
Copy link
Author

@cbommas
This issue still happened.
My build.gradle contains

implementation 'com.amazonaws:aws-android-sdk-appsync:2.6.26'
implementation 'com.amazonaws:aws-android-sdk-s3:2.7.2'
implementation 'com.amazonaws:aws-android-sdk-cognito:2.6.30'
implementation 'com.amazonaws:aws-android-sdk-mobile-client:2.6.31'
implementation 'com.amazonaws:aws-android-sdk-cognitoidentityprovider:2.7.2'
implementation 'com.amazonaws:aws-android-sdk-sns:2.6.+'

implementation 'com.amazonaws:aws-android-sdk-core:2.7.2'
implementation 'com.amazonaws:aws-android-sdk-ddb:2.6.31'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.4'

implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0'
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'

@472574155
Copy link
Author

472574155 commented Oct 31, 2018

@cbommas
Have you checked the jar file?
http://central.maven.org/maven2/com/amazonaws/aws-android-sdk-appsync/2.6.26/aws-android-sdk-appsync-2.6.26-sources.jar (Is maven url right?)

  1. download file aws-android-sdk-appsync-2.6.26-sources.jar
  2. (.jar) -> (.zip)
  3. unzip file
    4.find file (aws-android-sdk-appsync-2.6.26-sources⁩ ▸ ⁨com⁩ ▸ ⁨amazonaws⁩ ▸ ⁨mobileconnectors⁩ ▸ ⁨appsync⁩ ▸ ⁨subscription⁩ ▸ RealSubscriptionManager.java)
    5.line No.196

@scb01
Copy link
Contributor

scb01 commented Oct 31, 2018

@472574155
Thank you for pointing this out. I was able to track it down -the code in the github repo was updated after the v2.6.26 release as part of this PR #41 which contains the fix for the issue you are seeing.

Sorry about the confusion. I will get this released in the next few days and will post back on this thread once the release is completed.

@scb01
Copy link
Contributor

scb01 commented Nov 8, 2018

@472574155
v2.6.27 is released and contains the fix. Can you please let us know how it goes with the latest rev of the SDK.

@scb01 scb01 added bug Something isn't working and removed question General question labels Nov 8, 2018
@472574155
Copy link
Author

@cbommas thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending-response Issue is pending response from the issue requestor
Projects
None yet
Development

No branches or pull requests

3 participants