-
Notifications
You must be signed in to change notification settings - Fork 660
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
Threads in waitInNativeState never gets closed in KMM project. #6339
Comments
Thanks for opening this. 2500 threads sounds huge indeed. Are you even running that many queries? I can try to run thousands of queries on an iOS device, see what's happening but my hunch is that there's something else to it. I'll try that and report back. In the meantime, would you have a reproducer around that would help diagnose this issue? |
Tried running 100 queries and I don't get too many threads (reproducer repo here): A reproducer would help a ton. A thread dump of a few of the extra threads would also be interesting to investigate. |
Thanks @martinbonnin for looking into it. Yes, there is a timer that triggers a few queries so over time it can be a huge number of queries. |
Hm, I can try. And maybe a dumb question, how did you get your reproducer repo project compiling? it says cannot find "apollo_kotlin_ios_playground" for me. |
Hi 👋 I just open Screen.Recording.2025-01-06.at.09.49.09.mov
Can you share the full error? |
Not sure why, the project doesn't compile for me in Xcode16. I will try to create a reproducer project. |
I think this is because the project name wasn't enforced so if you cloned your project under a different directory name, Xcode wouldn't find it. Can you try again with martinbonnin/apollo-kotlin-ios-playground@faa8ce4? |
Version
3.0.0 and above
Summary
Hi guys,
We have a KMM project that uses the Apollo library. It can then run builds for our iOS and Android mobile apps to be consumed. It works well in version 2.x.x. However after we upgraded it to a new version (I tried 3.0.0, 3.8.4 and 4.0.0) it started to have an issue in iOS app where it keeps creating new threads that don't complete. Within a few hours it could create over 2500 threads created, eventually the app would crash. I think it creates the threads to handle the graphql queries (our apps) but somehow those threads are hung there forever.
Some related log:
2 xxx 0x7ce46c (anonymous namespace)::waitInNativeState(_opaque_pthread_cond_t*, _opaque_pthread_mutex_t*) + 68
3 xxx 0x7cd554 Worker::processQueueElement(bool) + 752
4 xxx 0x7cd1c0 (anonymous namespace)::workerRoutine(void*) + 104
Any inputs would be appreciated.
Steps to reproduce the behavior
No response
Logs
The text was updated successfully, but these errors were encountered: