WalletConnect / a2

An Asynchronous Apple Push Notification (apns2) Client for Rust
MIT License
136 stars 47 forks source link

Request to send keep-alives on idle connections #86

Open rajesh-blueshift opened 1 month ago

rajesh-blueshift commented 1 month ago

Dear team,

We have deployed our push service using a2 into production, but we are frequently observing ConnectionReset errors on http2 connections.

image

Our service is multi-tenant and the traffic is a steady stream of messages with idle periods and bursts in between. Although we are working around these connection resets by retrying it. I was thinking if we could do something like sending periodic keep-alive messages over the open connection.

The pushy library already does something like this: https://github.com/jchambers/pushy/pull/266

I read through the hyper documentation, and the default is to not send any keep-alives

chris13524 commented 1 month ago

I opened a PR to send the PING every 1 hour as per the recommendation by the APNs docs. Nothing though that there may be other factors causing connection resets (e.g. APNs closing the connection or network problems) so you should still use retries.

https://github.com/WalletConnect/a2/pull/87

rajesh-blueshift commented 1 month ago

Makes sense. Thanks for helping on this one. I appreciate it

rajesh-blueshift commented 1 month ago

Connection resets have stopped now. Thanks for a quick fix