-
Notifications
You must be signed in to change notification settings - Fork 754
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
Try to fix #4007 #4193
Try to fix #4007 #4193
Conversation
Relative issue |
TIL from the docs https://docs.mongodb.com/realm-legacy/docs/java/latest/#closing-realms
from the original issue #4007 the stacktrace looks like realm is still closing/has deleted a required file after it initialised the new instance of the database, very odd! 🤔
|
Actually I think all the Realm instance are closed, then when delete the files, but after that DefaultDownloadKeysForUsers wants to write to the database. Something is not properly cancelled. |
could it be that the wrong realm instance is somehow being used after logout? maybe a singleton somewhere is still referencing the closed instance |
b4a345c
to
0d85299
Compare
Looking again at the stacktrace from #4007 , I can see:
Which is called from Monarchy.writeAsync, and from our codebase here So this commit try to cancel all the pending async request(s). No crash observed, but I would like to see a log like like this:
But I have only seen
WDYT? |
@@ -379,7 +379,8 @@ internal interface IMXCryptoStore { | |||
|
|||
fun getOrAddOutgoingSecretShareRequest(secretName: String, recipients: Map<String, List<String>>): OutgoingSecretRequest? | |||
|
|||
fun saveGossipingEvent(event: Event) | |||
fun saveGossipingEvent(event: Event) = saveGossipingEvents(listOf(event)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
delay(TIME_TO_WAIT_MILLIS) | ||
timeToWaitMillis -= TIME_TO_WAIT_MILLIS | ||
} else { | ||
timeToWaitMillis = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also log when we fail to close all instances in time, would it be helpful for rageshakes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will see the bunch of similar logs and it will be enough
Still crashing from time to time :/
Log is always
Whatever the value of TIME_TO_WAIT_MILLIS (tested with 1, 10, 100, 200).
Also other crashes can occur, not all the time...