-
-
Notifications
You must be signed in to change notification settings - Fork 67
Enforce timeouts and add simple http2 client test cases #27
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
Conversation
Node 14 will become an LTS release in October.
Enforce a 10 second timeout - if any request takes longer than that, then assume that APNs is having networking or server issues so that the node-apn client can disconnect and reconnect in the background. Add tests of goaway, timeouts, protocol errors, connection termination by the server, and a few http response codes. Make eslintConfig work with modern eslint versions Arrow functions are newer than es6
4bef914
to
f070be3
Compare
@funkenstrahlen thoughts here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good for me. Let's just wait if @funkenstrahlen has any feedback and we can merge.
Don't time out immediately on the slowest request. - That would just lead to constantly creating and tearing down connections to APNs and possibly getting blocked. Instead, check if the last successful response was received longer ago than the configured timeout.
I got around to implementing that and added a test. @davimacedo If, for example, someone were sending thousands of push requests to APNs over dialup quality internet, this PR would probably lead to worse throughput without the latest commit due to constantly destroying and creating connections that were working but limited by reasons other than APNs having silently disconnected |
I don't have any other pending changes at the moment unless I see unexpected issues during real usage |
I've been running into issues with http2 and aborting requests due to goaway frames, possibly related to multiple goaway frames being sent at once, which may be something that may or may not only occur in these unit tests with the test http server I've implemented, not in APNs.
This time, it was reproduced in travis, but only for node 8 so far, https://travis-ci.com/github/parse-community/node-apn/jobs/394316640 https://nodejs.org/en/about/releases/ indicates that node 10 is the oldest version that's still supported, so this
|
I've inspired in your PR and created a new one: #29 |
Closing in favor of #29 |
Enforce a 10 second timeout - if any request takes longer than that,then assume that APNs is having networking or server issues so that
the node-apn client can disconnect and reconnect in the background.
Enforce a 10 second timeout - If a request is sent but there have been no successful response to any
request made on that connection in the last 10 seconds, then assume the connection is dead and terminate the connection.
There's probably a better way to do this, e.g. also check if there's been a successful response in the last 10 secondsfor a different request, but this is a starting point and a work in progress.
For #26
Fixes #24
The timeout can be passed in as follows from the Provider to the Client:
new apn.Provider({..., timeout: 30000}); // raise the request timeout from 10 seconds to 30 seconds