-
-
Notifications
You must be signed in to change notification settings - Fork 619
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
Issues with bulk messages in the new aioapns dependency (apns_async) #744
Comments
I worked a bit further on this and it appears to be related to Fatal1ty/aioapns#41 (which in turn probably is related to another issue in h2). I did manage so send a several hundred thousand push notifications with this retry-logic: mikaelengstrom@ad9bd17 |
So digging deeper, one of the core issues was having non-legit registrationIds (such as BadDevice) in the device-list, making the connection overload and crash for some reason. But appart from that i had some issues with concurrency and the lib simply never terminating properly. I managed to develop a version where bulk-messaging works fast and performant as long as there are few or none non-legit registrationids: https://github.com/mikaelengstrom/django-push-notifications/blob/master/push_notifications/apns_async.py This update does these main things:
Any thoughts on this or should i just create a PR? |
Nice catch! I think creating PR is a good idea, and we can sort out issues inside the PR (tag me too pls). (Btw don't make same mistake as me creating PR from your Is there some additional work to be done in aioapns or h2? |
Previous version implemented aioapns in a way that made it hang indefinetly. Especially when receiver list contaned a lot of bad tokens. Having a lot of bad tokens still affects the reliability and transfer speed of notification sets, which is why this fix also deactivate devices for error codes BadDeviceToken and DeviceTokenNotForTopic unlike previous versions.
@pomali sorry for late reply, i have been very busy. I have now opened a PR #746 - I do think there is some further work to be done in aoiapns/h2 or its sub-dependencies for 100% reliablity, however im unable to pinpoint what, but there are still some SSL errors going on when the connections are going super warm. In my pretty extensive testing the delivery rate is way above 99.9% though. @HashimJVZ - I think it would be great if your patch was applied after my more excessive refactor of the module. |
Previous version implemented aioapns in a way that made it hang indefinetly. Especially when receiver list contaned a lot of bad tokens. Having a lot of bad tokens still affects the reliability and transfer speed of notification sets, which is why this fix also deactivate devices for error codes BadDeviceToken and DeviceTokenNotForTopic unlike previous versions.
Previous version implemented aioapns in a way that made it hang indefinetly. Especially when receiver list contaned a lot of bad tokens. Having a lot of bad tokens still affects the reliability and transfer speed of notification sets, which is why this fix also deactivate devices for error codes BadDeviceToken and DeviceTokenNotForTopic unlike previous versions.
Hi, i have been trying out the latest async version at scale (Im sending to 200k+ devices in production) and it does not really work for bulk messaging. Already around sending messages to 100 devices it justs hangs indefinitely and never terminates.
I have been trying to fix the issue, however i have zero experience with the underlying libraries (aioapns, h2, aiohttp) and dont really know how its supposed to work. But i managed to make it somewhat stable by using semaphores limiting the number of paralell requests and raising the connection limit. Implementation can be viewed here: mikaelengstrom@9a95da8
Unfortunatly, performance take quite a hit when done this way.
Very thankful if someone who knows this stuff better could check it out. The original contributor @pomali maybe? :)
The text was updated successfully, but these errors were encountered: