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
AWSPinpointSessionClient blocks main thread #614
Comments
Anyone out there? It's quite a serious problem and prevents the use of Pinpoint in production. |
Hi, Thanks for reporting this. I will reach out to the service team and revert. Thanks, |
@jberkel did you figure a solution to this problem? Our app is already in production. now it gets killed by system all the time due to this bug. |
@yinglin83 Well I debugged the app and identified the problem (see above), a fix is probably not too complicated but I have other priorities right now. very likely won't use the service anyway, given the low quality of the code and the slow response times. |
@jberkel Thanks for pointing that out. I agreed that they need to improve the quality of pinpoint code before asking everyone to jump onboard. I wonder how many poor mobile startups out there having this code in production. This issue has huge impact on our app store ranking. This update drop our ratings from 5 stars to 3.5 stars. This is SERIOUS! |
Great catch @jberkel and appreciate the thorough write up and debug. Looks like we not only have some work to do in the Pinpoint session client but also with our GitHub issue response times. We apologize for the lack of responsiveness along with any problems this may have caused. You should expect a fix shortly and please know that we value your continued patience as we actively dive in and resolve this issue. |
Ok looks like the change is all approved and will be released shortly. |
Unfortunately looks like the change broke existing functional tests and is pending further work. |
A band-aid solution would be to find the waitUntilFinsihed function, and when it checks if the thread is running on the main, put it in the back, So:
} This should help those looking for a quick fix, just comment out the [self warnOperationOnMainThread]; part to stop it showing up now |
We have fixed it in 2.5.9 |
To help us solve your problem better, please answer the following list of questions.
AWSPinPoint
2.5.2
Devices
No
No
CocoaPods
I use
AWSPinpointAnalyticsClient
in my app to track some events, using the default configuration (5 sec session timeout).When my application goes into background state I noticed a couple of warnings in the console:
Followed (occasionally) by the process getting killed by the watchdog:
I attach the debugger as hinted in the log message:
Getting the following backtrace:
After checking the code it looks like
NSTimer
fires after the prefined timeout without passing a block in theuserInfo
dictionary:https://github.com/aws/aws-sdk-ios/blob/master/AWSPinpoint/AWSPinpointSessionClient.m#L122
It ends up calling
endCurrentSessionTimeoutWithTimer:(NSTimer*)
, followed byendCurrentSessionWithBlock:block
(with the block still being nil).In
endCurrentSessionWithBlock:
the application finally hangs inwaitUntilFinished
on the main thread.The text was updated successfully, but these errors were encountered: