apn_sender
apn_sender copied to clipboard
This lib with Resque creates new connection to APNS each time
You wrote in README
sends them along to Apple over a single, persistent socket
but with Resque it creates new connection and new client object each time
D, [2013-11-21T13:05:55.474087 #17156] DEBUG -- : 2013-11-21 13:05:55 +0200: Connecting to gateway.push.apple.com:2195...
D, [2013-11-21T13:05:55.474160 #17156] DEBUG -- : 2013-11-21 13:05:55 +0200: #<APN::Client:0x007f3d00d888a0>
D, [2013-11-21T13:05:56.206347 #17156] DEBUG -- : 2013-11-21 13:05:56 +0200: Message sent.
...
D, [2013-11-21T13:06:01.213870 #17168] DEBUG -- : 2013-11-21 13:06:01 +0200: Connecting to gateway.push.apple.com:2195...
D, [2013-11-21T13:06:01.214269 #17168] DEBUG -- : 2013-11-21 13:06:01 +0200: #<APN::Client:0x007f3d00dba530>
D, [2013-11-21T13:06:01.807808 #17168] DEBUG -- : 2013-11-21 13:06:01 +0200: Message sent.
Maybe I'm doing something wrong, but can you explain this behavior?
@k3mm0tar that was a regression on version 2.0.0 .. You can either use version 1.0.x that doesnt have that bug or wait for a patch on 2... Also PR are more than welcome, so fell free to submit a patch with the fix.
thanks
It seems this issue is not present in 2.0.1 anymore. Using Resque with a single persistent connection.
@toto I'm having this issue on 2.0.1. I suspect that that's the reason why apple is shutting down our push.
@arthurnn we can take care of that. Do you have an idea where the issue can be? Is there any spec failing?
Please show the way and we'll be glad to take it from there.
Thanks.
Due to Resque forking model, it creates new socket for every fork.
I can't understand why, because my Mongo connection remain the same.
May be something wrong with Resque.
I try to create connection before Resque start and use it in my push job and got Broken pipe (Errno::EPIPE)
@toto I tried, every time got new connection.
@k3mm0tar True, I think I had a problem in my test setup. Now it does the same thing here as well.
This is also happening with Sidekiq.
Is it still the case today?
+1
To be honest I have a stable environment now, using one of my forks, and I don't want to conduct tests on unstable releases. But would be nice to have a new version of the gem officially released (the last one is from 2011).
If this happens, I can test it and check if this is still open.