-
Notifications
You must be signed in to change notification settings - Fork 453
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
Push Notifications are not being resent after I/O problems are resolved. #14
Comments
To clarify, the steps here are:
Is that right? Also, which version of Pushy are you using? Thanks! |
Hi, in my application I have a class which creates only ONE instance of Pushy PushManager for all the incoming requests. Steps I am following:
Why should I start the PushManager after enqueieung a push notification? I am using the 0.1.2.SNAPSHOT version, cause the 0.1.1 kills the main thread. |
Thanks for the details!
No need to do that. Sorry; I didn't mean to be prescriptive. I was just wondering if I had the sequence right. |
I just noticed while testing following strange behaviour:
Now:
It seems notifications are just being resent the first time a reconnection happens. Beginning from the second time, no old push notifications are being dequeued, resent.. |
I'm having a hard time reproducing this; could I trouble you to set your logging level to |
Hi, please find as gist the log output with logging level trace So I tried following:
Best Regards, Henri |
Please pardon the delay in getting back to this issue. It appears that the reproduction case here is perhaps a bit simpler than initially reported:
@agarajh in the gist you posted, these two lines are right next to each other:
I recognize those are ~15 seconds apart; do you know what triggered the connection closure at 2013-11-12 11:12:51,161? In my testing, the message will still be sent if the internet connection is restored before the TCP connection is closed. |
Also, @agarajh, as a point of clarification, is this a thing that happened to you in the wild, or were you just enabling/disabling your internet connection to simulate loss of connectivity? |
Hi, Mit freundlichem Gruß HENRI AGARAJ SHS VIVEON GmbH Sitz der Gesellschaft: Neuss Die in dieser E-Mail enthaltenen Informationen sind vertraulich und ggf. rechtlich geschützt. Bitte benachrichtigen Sie den Absender, falls Sie nicht der beabsichtigte Empfänger sein sollten, und löschen Sie bitte diese Nachricht umgehend aus Ihrem System. Das unerlaubte Kopieren, die Offenlegung sowie die Weitergabe dieser E-Mail sind nicht gestattet. Am 27.11.2013 um 17:52 schrieb "Jon Chambers" <[email protected]mailto:[email protected]>: Also, @agarajhhttps://github.com/agarajh, as a point of clarification, is this a thing that happened to you in the wild, or were you just enabling/disabling your internet connection to simulate loss of connectivity? — |
I've done some poking at this; I think we're doing all we can here, and this is a fundamentally unresolvable problem given the design of the APNs protocol. All we know -- and all we CAN know -- is that we successfully handed the notification off to the OS. Because APNs never acknowledges notifications in the affirmative, we have no way of telling the difference between a notification that was successfully handled by the APNs gateway and a notification that never even arrived at the gateway. I'm afraid the best we can do for now is document the issue (see c8e7fa1). Please let me know if you feel that I've misunderstood the issue or if you think there's a better solution to be had. Thanks kindly, and I'm sorry I don't have something better to offer! EDIT: To clarify, I don't think this is a bug unique to Pushy. As far as I can tell, any APNs client is likely to have this issue. |
Hi @jchambers, We are looking at using Pushy and wanted to clarify that I understand this thread. Is the issue that @agarajh is talking about b/c Apple is not acknowledging receipt of notifications at the application level, and therefore that it is possible to experience an error while sending, and then end up in a situation where we don't know which notifications to resend? Please forgive me if this is dumb or I'm totally missing something, I was hoping to find in the Pushy lib source code clear evidence that if an error might have happened then it would definitely be thrown and propagated to the client code. I saw that for the 2 failures that @agarajh demonstrated in his gist, that he logged a Netty scoket channel doConnect error (this seems to imply that at very least we should definitely know if something might have gone wrong), but from looking at the source code (I have not experimented with Pushy hands-on myself yet), I don't see anywhere that Pushy informs the client code of the fact that notifications might have been lost. Again, sorry if I've misunderstood, we are excited to try out your lib, but want to make sure we will be able to reliably confirm that no queued notifications are lost without us at least knowing that some notifications might have been lost. Thanks!! |
Well, yes and no. It's true that we won't necessarily know in a timely manner what happened to a notification after it left our control. That said, Pushy offers the following guarantees:
In both cases, we're able to offer those guarantees because we close connections by sending known-bad notifications to the gateway. Because notifications are processed by the gateway in order, we know that rejecting our known-bad notification means that everything before that notification was processed successfully, while everything sent after that notification needs to be re-sent. Until the gateway rejects a notification, we don't know anything about the state of any sent notifications. So, in short, we will eventually know what happened to everything that went out the door.
That's true, but again, that's because we can't tell in any way except by closing the connection with a known-bad notification. Three things can happen when we try to send a notification:
As for connection failure, I'd call your attention to #51. That will go in to v0.3 (again, soon). Hope that helps! |
…and, to follow up, the case @agarajh ran into is a little weird. What happened there is that we got the notification out the door, but then got stuck in that "waiting for an unknown amount of time" phase. The shutdown in that case DID have a timeout, so the guarantees about notification state didn't apply. Had the |
I disabled any connection to the internet. By doing this while trying to push one notification i get the following error:
2013-11-11 19:18:51,928 | push | DEBUG | ApnsClientThread
|ApnsClientThread-1 beginning connection process.
2013-11-11 19:18:51,939 | push | ERROR | ApnsClientThread
|ApnsClientThread-1 failed to connect to APNs gateway.
java.nio.channels.UnresolvedAddressException: null
Pushy tries then infinitely to establish a connection to APNS.
I enabled the connection to the internet: Now Pushy logs following:
2013-11-11 19:18:51,939 | push | DEBUG | ApnsClientThread
|ApnsClientThread-1 beginning connection process.
2013-11-11 19:18:54,272 | push | DEBUG | ApnsClientThread
|ApnsClientThread-1 connected.
2013-11-11 19:18:54,273 | push | DEBUG | ApnsClientThread
|ApnsClientThread-1 waiting for TLS handshake.
2013-11-11 19:18:55,052 | push | DEBUG | ApnsClientThread
|ApnsClientThread-1 successfully completed TLS handshake.
So up to now everything is working like predicted. Pushy managed to reconnect to the APNS server after internet connection was active again.
Nevertheless, the push notification which was sent while the internet connection was inactive, is not being resent. It seems like the push notification was never enqueued. I am not getting any error here, still the old push notification gets lost forever. All other new push notification requests are being sent to APNS successfully.
Thank you a lot for your time and I hope I was clear enough to describe the issue i am facing.
Regards,
Henri
The text was updated successfully, but these errors were encountered: