-
Notifications
You must be signed in to change notification settings - Fork 473
Serial Executor hangs on Android 9 #84
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
Comments
@wfilleman Hey, Thanks for reporting this. This is interesting case, seems like serial executor chokes on multiple calls. Did you try it on other Android versions (before Pie)? thanks. |
Hi @krizzu , I just tried this on Android 8 emulator and saw the same lockup results. And yes, thank you, I meant getItem. Wes |
I've tried to replicate situation like you mention. I had 4 consequent Can you provide some repro steps that's allow me to have a look? Is there a chance that some of your thanks. |
I've got the exact same problem, here is my implementation, inside a
Tested on Android Pie (One Plus 6T). |
Hi @krizzu, similar to @theolavaux my implementation is very simple:
The logging is there so I can track when AsyncStorage returns and when it gets lost on the native side. The caller's "catch" is never executed. When I debugged this on the native side, the serial executor is hung up. It never executes and never throws an error. Something I'm not sure how to capture or show is I'm also using Parse and Parse Server. The Parse client uses AsyncStorage as well and is actively trying to retrieve values from AsyncStorage in parallel to the rest of my RN app starting up as part of the Parse Client SDK internals. So, for sure, there are parallel requests to AsyncStorage happening and not just a clean promise chain of gets. Wes |
I'm going to keep in mind that issue while improving implementation for v2. |
@krizzu FYI the new AsyncStorage_dedicatedExecutor=true in gradle.properties with AsyncStorage 1.6.1 seems to have fixed this issue I was experiencing on Android. Thank you for making this an option! |
Glad you found that useful :) |
Current behavior
I'm upgrading my RN app from 0.56 to 0.59.3 and decided to move back to the community AsyncStorage solution. The problem I'm running into is that the serial Executor is getting jammed up processing getKey requests after about the 3rd request for a getKey. The result is in the JS side, the Promise never returns and locks up the app.
Expected behavior
The Serial Executor in use by the AsyncStorage solution would process the AsyncStorage request or fail but not go into a locked up state.
Repro steps
In my RN app, I have 4 AsyncStorage getKey requests during startup which all happen in succession. I've never seen the 4th request return. Sometimes I'll see requests 1-3 return before it hangs on the 4th. This happens on the Simulator and on the device. I've only tested on Android 9 sim and Pixel 2 Android 9.
To point to the Serial Executor as the problem, I removed all references to the Serial Executor in the AsyncStorage code base and just let the SQL Lite requests run on the main thread and it works perfectly.
Environment
The text was updated successfully, but these errors were encountered: