No response from APNs, stream forcefully closed

We are experiencing issues with our push notification implementation. We are seeing sporadic cases where we do not receive a response for a message, but eventually encounter a "Stream forcefully closed" error. Hoping someone has run into this, and might be able to suggest how to diagnose and address.

This sounds similar to the problem posted about here: https://developer.apple.com/forums/thread/103186. However, unlike in that case where it sounds like failures were consistent, in our case the application will send messages fine for hours or days before encountering the issue. We've experienced this issue 3 times in 2 different environments in the past 5 days (between Oct 1 and 5, 2020).

Our application is written in Python and runs on CentOS 7. We use a library for communication with APNS (https://github.com/Pr0Ger/PyAPNs2). Here's a snippet of logs from our push notification application.

2020-10-04 05:29:50 pusher.apns2worker.emit logger:144 - APNs unkonwn error
Traceback (most recent call last):
File "/home/mobile-live2/alertpush-apns/env-2.6/lib/python2.7/site-packages/alertpush/apnsworker.py", line 207, in push
priority=NotificationPriority.Immediate)
File "/home/mobile-live2/alertpush-apns/env-2.6/lib/python2.7/site-packages/apns2/client.py", line 172, in send
notificationbatch
result = self.get
notificationresult(pendingstream.streamid)
File "/home/mobile-live2/alertpush-apns/env-2.6/lib/python2.7/site-packages/apns2/client.py", line 116, in get
notificationresult
with self.
connection.getresponse(streamid) as response:
File "/home/mobile-live2/alertpush-apns/env-2.6/lib/python2.7/site-packages/hyper/http20/connection.py", line 312, in getresponse
return HTTP20Response(stream.getheaders(), stream)
File "/home/mobile-live2/alertpush-apns/env-2.6/lib/python2.7/site-packages/hyper/http20/stream.py", line 230, in getheaders
self.
recvcb(streamid=self.streamid)
File "/home/mobile-live2/alertpush-apns/env-2.6/lib/python2.7/site-packages/hyper/http20/connection.py", line 768, in
recvcb
self.
getstream(streamid)
File "/home/mobile-live2/alertpush-apns/env-2.6/lib/python2.7/site-packages/hyper/http20/connection.py", line 289, in getstream
raise StreamResetError("Stream forcefully closed")
StreamResetError: Stream forcefully closed 

Any insights would be greatly appreciated!
I have the same problem, but we are using Java

Libraries connected to APNs use https://github.com/jchambers/pushy
No response from APNs, stream forcefully closed
 
 
Q