Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Uniqush doesn't handle invalid payload received by apns server #24
GCM is ok but apns has restrictions of maximum payload of 256 bytes. This happens when the user sends a huge message or simply messages that are utf8-encoded. Uniqush should complain about this issue.
Uniqush will be OOM killed by the kernel if handling this 'invalid payload'. We tested this with concurrent connections sending messages via celery. We had 8 workers and with 4 concurrency running each worker. When trying to send an invalid payload size, uniqush will crash and killed by the kernel.
@cmabastar-gumi Thanks for your report!
uniqush-push does not check the size of the message, I can fix this. However, OOM is not what I expected. Even if the message is too large, as long as it fits into the memory, there should not be OOM.
I tried UTF-8 characters with APNS, it can be correctly sent (and displayed on the screen.)
Let me see if I can reproduce the bug. It would be great if you can provide me more information so that I can easily reproduce it.
@cmabastar-gumi I tried large payload with version 1.4.3, it can report error correctly. However, I didn't try concurrent connections. BTW, I just added a line of code to check the payload size before sending it. I hope it can fix this problem. Do you want me to build a binary for you? (it's in the exp branch)
@cmabastar-gumi I probably figured out the reason of OOM error. Would you please provide the answer for the following questions?
referenced this issue
Jul 3, 2013
@monnand Hi, Sorry for the late reply. Just got into the office.
Here's the message from /var/log/messages: (Not sure if this helps )
@cmabastar-gumi Your report is very helpful. I just tested the APNS and it is really slow.
Now let's first focus on the payload size. Right now, I have created a set of binary files which has already fixed the payload size problem. i.e. It will refuse to send anything if the payload is too large. Besides, it also fixed a memory leak bug, which may or may not be related to the OOM error.
These binary files can be downloaded from:
I'm not sure if they can fix your problem, but you can give it a try.
NOTE: I did not improve performance in the code now. I will profile the program and improve the performance in the next week. (I have a travel plan this week.)
Thank you very much for your report. I will do my best to fix it.
Just wanna know if you'll do a fix to improve sending messages to APNS? I'm
Christopher Marlon S. Abastar
On Sun, Jul 7, 2013 at 3:23 PM, monnand firstname.lastname@example.org wrote:
This email and any files transmitted with it are confidential and intended