-
Notifications
You must be signed in to change notification settings - Fork 731
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
Multiple Websocket Crashes after updating to 0.43.0 #1808
Comments
Thank you for the report. These stack traces don't really give us enough information to deduce any sort of cause yet. It seems like it's more likely something that is going to be able to be tracked down with help from the Starscream community. But please keep us updated as you debug and come up with more information. If there is something involving our Starscream integration that is causing this, I'd love to know. |
Yep didn't expect anyone to have a solve looking at these stack traces, was more looking to see if anyone else has encountered anything similar while upgrading to the more recent versions of apollo-ios (that include Starscream 4.x.x) that might aid in the information gathering and investigation of the issue. Will keep this thread updated accordingly. |
I have encountered exactly the the same issue. Downgrading to Apollo GraphQL version 0.41.0 with StarScream 3.1.1 fixed crashing. |
@STomperi thanks for weighing in, super helpful to hear that downgrading to a version running Starscream 3.1.1 is an option. |
So the next step is diffing the versions to see what has changed! It could be a change in Apollo or in Starscream that is causing it. If you are able to confirm that it's a Starscream issue, we can just roll back our dependency for the time being. If it's an Apollo issue let me know! |
@AnthonyMDev Rolling back is a little easier said than done since it's a major version change and there were some pretty significant breaks, but it could be doable. Looking at daltoniam/Starscream#773, it looks like there were some fixes applied that related to making sure things were nilled out in an internal Looking at the docs around
Does that help come up with any kind of messaging we might be able to get more info out of from the system? I'm also curious if the issue is happening on versions of iOS < 13, since as I recall, a big piece of the 4.0 release of Starscream was setting up to use the |
@designatednerd haven't been able to reproduce myself but now that you mention it I am seeing this extra piece of information in some of the crash report data: |
The crashes on 12 are the ones that pique my interest since that would be using a different underlying websocket engine instead of This issue seems like it might be relevant - @STomperi you submitted a patch with #1740 that wound up as part of the 0.43.0 release - are you saying that's not helping your crashes? @philfi are you also seeing these crashes on 0.42.0? That has the 4.x version of Starscream but not the changes @STomperi added. |
Sorry can only speak to 0.35.0 and 0.43.0 for now. Currently back on 0.35.0 and am planning on updating to 0.41.0 next (pre 4.x changes). |
OK cool, sounds like a plan. |
@designatednerd We are using 0.42.0 and we have been experiencing same crashes.
|
Ick, that's no bueno. Are you able to get more information about where the memory is leaking from Instruments, or provide a minimal replication project? That would be super, super helpful in tracking down the source of this. |
Basically if SSL connections are rejected it continuously tries to make new connections forever, never releasing the old ones. |
@kylebrowning can you confirm if you're on 0.42.0 vs 0.43.0? A fix for exponential socket connections went out with 0.43.0 so it would be good to know if there's still problems with that. |
I upgraded to 0.43.0 and it was still happening. |
blargh, but good to know. I'll see what we can figure out. |
@designatednerd maybe this will help. This was in my console
When it eventually locked my UI on the main thread I hit pause on the execution and this is what I saw. |
Will try to dive in to this. |
That fix I made is for a crash that occurs very seldom, but was reliably noticed by thread sanitizer. So far I have seen only couple one or two crashes with app that has lot's of users. On the other hand, StartScream 4.x crashes occur often. About once per day for each active user, so this bug is a really bad problem. Also for me 0.42 crashes a lot in StarScream. |
I want to invest some time in
@kylebrowning Could you tell me what If the web socket receives an error, it should stop trying to reconnect. When your SSL connection is rejected, what event is causing it to attempt to reconnect? I want to reproduce this case, but I'm not sure what the actual event that's causing it looks like. |
@kylebrowning It would also be really helpful to get an idea of exactly what objects are leaking. When it keeps making new connections and retaining the old ones, what objects are you getting explosion on? I don't imagine that it's the actual |
Due to the multiple stability issued we've experienced recently, we've decided to create a fork of Starscream and revert to using Starscream 3.x. See #1861 for more information. This will remove some of the new functionality that Starscream 4.0 provided. Because we are on a fork of Starscream now, if you would like any of that functionality back, please feel free to make a PR to add it. You can make any additions to Starscream 3.x needed in a PR to our fork https://github.com/apollographql/Starscream and we would be happy to help with integrating them back into the A new version with these changes is expected to go out in the next couple of days. This will be a pretty big breaking change, but we believe it is for the best to solve the stability issues that have been uncovered. Please let us know if you continue to have issues after updating to this new version! |
Version 0.45.0 has been released with the above mentioned changes. I'm closing this issue, in hopes that its resolved in this release. If you continue to have issues with Web Sockets please feel free to open a new issue! |
Bug report
Recently updated from 0.35.0 to 0.43.0 and have encountered a few new crashes related to websockets usage. Didn't find any similar issues reported here but have found somewhat similar reports in the Starscream library, namely daltoniam/Starscream#773. However that issue was supposedly resolved in the 4.0.4 Starscream release that is used in the latest (0.43.0) release of apollo-ios. Have requested more information on the status of that Starscream issue but am curious if anyone else using graphql subscriptions has encountered this issue? Only have a few different crash stack traces to work off of atm but will update as the investigation proceeds. Any assistance/insight is greatly appreciated!
Versions
Please fill in the versions you're currently using:
apollo-ios
SDK version: 0.43.0Steps to reproduce
Have been unable to reproduce thus far.
Further details
Will update with more information as we gather it but for now here are the stack traces that we have collected from crashes thus far, starting with the one that has been most frequent.
Stack Trace 1:
Stack Trace 2:
Stack Trace 3:
Stack Trace 4:
The text was updated successfully, but these errors were encountered: