Realm-java: Reconnect seems to be broken since 4.3.0

Created on 16 Dec 2017  ยท  7Comments  ยท  Source: realm/realm-java

On version 4.3.0 or later the sync session doesn't reconnect after a connection loss. With version 4.2.0 reconnecting works fine. I'm using version 2.2.0 of the Realm Object Server.

This is what is logged by Realm:

12-15 23:50:33.038 30915-30948/my.app.name E/REALM_SYNC: Connection[2]: Reading failed: Software caused connection abort
12-15 23:50:33.039 30915-30948/my.app.name I/REALM_SYNC: Connection[2]: Connection closed due to error
12-15 23:50:33.039 30915-30948/my.app.name D/REALM_JNI: error_handler lambda invoked
12-15 23:50:33.040 30915-30948/my.app.name E/MyApp: BAD_SYNTAX(103)
                                                                          Software caused connection abort
                                                                              at io.realm.SyncSession.notifySessionError(SyncSession.java:178)
                                                                              at io.realm.SyncManager.notifyErrorHandler(SyncManager.java:324)
12-15 23:50:33.040 30915-30948/my.app.name D/REALM_SYNC: Connection[2]: Reconnecting in 0 milliseconds
12-15 23:50:33.040 30915-30948/my.app.name I/REALM_SYNC: Closing Realm file: /data/data/my.app.name/files/realm-object-server/l9NZ8m0iVHhX0Zoce2cFcJJxoCD3/l9NZ8m0iVHhX0Zoce2cFcJJxoCD3/default
12-15 23:50:33.040 30915-30948/my.app.name E/REALM_SYNC: Connection[1]: Reading failed: Software caused connection abort
12-15 23:50:33.040 30915-30948/my.app.name I/REALM_SYNC: Connection[1]: Connection closed due to error
12-15 23:50:33.040 30915-30948/my.app.name D/REALM_JNI: error_handler lambda invoked
12-15 23:50:33.041 30915-30948/my.app.name E/MyApp: BAD_SYNTAX(103)
                                                                          Software caused connection abort
                                                                              at io.realm.SyncSession.notifySessionError(SyncSession.java:178)
                                                                              at io.realm.SyncManager.notifyErrorHandler(SyncManager.java:324)
12-15 23:50:33.041 30915-30948/my.app.name D/REALM_SYNC: Connection[1]: Reconnecting in 0 milliseconds
12-15 23:50:33.041 30915-30948/my.app.name I/REALM_SYNC: Closing Realm file: /data/data/my.app.name/files/realm-object-server/l9NZ8m0iVHhX0Zoce2cFcJJxoCD3/ZX9HtldX1zehzBx6YCS70EUfsg53/default
12-15 23:50:33.788 30915-30915/my.app.name D/REALM_JAVA: NetworkListener: Connection available
12-15 23:50:33.805 30915-30915/my.app.name D/REALM_JAVA: NetworkListener: Connection lost
12-15 23:50:33.840 30915-30915/my.app.name D/REALM_JAVA: NetworkListener: Connection lost
12-15 23:50:57.532 30915-30915/my.app.name D/REALM_JAVA: NetworkListener: Connection available
12-15 23:50:59.203 30915-30915/my.app.name D/REALM_JAVA: NetworkListener: Connection available
12-15 23:50:59.227 30915-30915/my.app.name D/REALM_JAVA: NetworkListener: Connection available
T-Bug

Most helpful comment

@nhachicha I just checked. This seems to be fixed โœ…
Many thanks ๐Ÿ‘

All 7 comments

Thanks for reporting this issue.

This line
12-15 23:50:33.040 30915-30948/my.app.name E/MyApp: BAD_SYNTAX(103)
(and the other similar one)
look suspicious. We need to figure out where the bad syntax comes from.

Can you reproduce this case?
In that case, can you turn on trace level logging and post the log here?
Do you have a code example that reproduces this behavior?

i got the same issue.
Realm server is from docker
docker run -p 9080:9080 -e ROS_TOS_EMAIL_ADDRESS=xxxx realm/realm-object-server
with default setup.

Trigger doze mode by following steps:
https://codelabs.developers.google.com/codelabs/android-doze-standby/index.html?index=..%2F..%2Findex#2

Actually, we are aware of some reconnect issues.
We should have a new release that solves those issues out soon.
It is likely, that the issues seen here will be solved by that.
I will report back when we release a solution.

Hi @joluet this should have been fixed in Sync 2.1.10. Can you please try with Realm Java 4.3.2?

@nhachicha I just checked. This seems to be fixed โœ…
Many thanks ๐Ÿ‘

Seems to be exactly what was discussed and found in https://github.com/realm/realm-java/issues/5403#issuecomment-357450680 ๐Ÿ‘

Thanks for the feedback

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jjorian picture jjorian  ยท  3Comments

mithrann picture mithrann  ยท  3Comments

Merlin1993 picture Merlin1993  ยท  3Comments

tloshi picture tloshi  ยท  3Comments

Frasprite picture Frasprite  ยท  3Comments