expo-community / expo-server-sdk-python

Exponent Server SDK
MIT License
146 stars 42 forks source link

NewConnectionError #26

Closed sjatkins closed 3 years ago

sjatkins commented 4 years ago

If I loop sending new push requests to my device (thus same token id) I sometimes randomly get HTTPSConnectionPool(host='exp.host', port=443): Max retries exceeded with url: /--/api/v2/push/send (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc73474ea90>: Failed to establish a new connection: [Errno 111] Connection refused'))

Is that sort of thing some throttling at your API servers or at my device (ios phone btw) or what generally. It is maddeningly sporadic. I am using the default push pattern from the github top level documentation.

I notice underneath that it uses requests but does not take advantage of request sessions which I believe reduces the number of connections.

I tried having only a single PushClient instance instead of creating one per push but that didn't seem to help.

julianpacker commented 3 years ago

Thanks for the post. I am occasionally receiving the same message, I actually assumed it was a bad internet connection / temporary intermittent issue with no real solution. Any chance you've looked into this further and have a better explanation?

julianpacker commented 3 years ago

If you're able to can you review #42?

I'll be pushing this Monday if my weekend testing goes well

julianpacker commented 3 years ago

Closing this, as solved (I think) by #42