-
Notifications
You must be signed in to change notification settings - Fork 730
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
Crash in URLSessionClient #1181
Comments
Looking at the stack, there's a bunch of Can you answer a few questions for me to help narrow down what might be going on:
|
I'm getting this too! Normal URLSessionClient. Default cache I think. Individual requests but a few of em. |
@sneakyness Also getting this when cancelling or are you seeing it at a different time? |
@designatednerd, see answers below.
Using the default URLSessionClient, no sub-classing.
We are using the
Individual requests.
We use a singleton/ shared client for all the requests. |
seeing the same crash after updating. reverted back to previous version that was working for us ( The same client is used for all apollo requests and it is only re-allocated if the session configuration headers need to change (i.e. Bearer token has changed and needs to re-set.) This requires a re-allocation of the Apollo client since the session configuration cannot easily be changed once passed. |
@designatednerd Just normal requests, some of them nest fairly deep and we hit a few of those rapid fire up front, which is what seems to do it. Sometimes the promise chain is longer, other times it doesn't crash but the app is somehow up in the 100's for thread lifecycles (!) I thought I might have been trying to be too concurrent, so I pulled all that out and it persisted. If I had to ship tomorrow, I'd follow pkluz and downgrade to 0.24. Should I hoard crashlogs in the meantime? |
Yes any crashlogs y'all can share would be a huge help. I'll try to see if I can throw enough concurrent requests at it to make it crash locally. |
Oh one more question: For those of you seeing this crash, are you seeing it on both simulator and device, or device only? |
tested on device only |
OK as I was looking at the code it occurred to me that particularly if things are getting kicked off by Before I go too far down other rabbit holes, can I ask the brave among you to see if this reasonably simple patch fixes the issue without totally tanking performance: |
I yeeted it, definitely seems better. Far less threads being burned. I can't get it to crash 🚀 |
OK - PR opened at #1184 - would appreciate any further feedback on this if anyone has it. If I don't hear anything else, I'll ship that as a patch release tomorrow. |
Both, I can reproduce the crash on the device and simulator.
The patch seems to fix the crash, I can't get the app to crash anymore. |
Fix shipped with |
I'm experiencing a crash(EXC_BAD_ACCESS) in the
URLSessionClient
when a pending GQL request gets deallocated. For example when a screen is loading data and dismissed before completing the request.The crash is happening in
sendRequest(_ request: URLRequest, rawTaskCompletionHandler: RawCompletion? = nil, completion: @escaping Completion) -> URLSessionTask
, when performingself.rawCompletions[dataTask.taskIdentifier] = rawCompletion
.See also the attached crashlog.crash.zip.
In my case there are multiple GQL request performed while the screen gets deallocated. All pending requests are cancelled before the screen gets removed.
If I can provide more information or it needs more explanation, please let me know.
The text was updated successfully, but these errors were encountered: