-
Notifications
You must be signed in to change notification settings - Fork 26
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
Close immediately after requests are done #16
Comments
Note: I just ran the same test with stoppable, and it closes once the last request finishes. Obviously it has other issues though :) |
Hey, thanks for reporting this – are you available to PR either a failing test case or a fix + test? |
I can provide access to my demo code that shows this library and stoppable don't do the same thing later today. I did have a look at the tests and the code to see what I could do, but it's tricky to grasp quickly. As far as I can tell the first test here https://github.com/gajus/http-terminator/blob/master/test/helpers/createTests.js#L38 is what should be testing this case, but it doesn't include testing that the server closes. I can't see any test with a strategy for testing that the server closes? If you can point me in the direction of the pattern/strategy you would use for that, I can probably work from there. |
Also just to add - the code doesn't have much in the way of comments except "// $FlowFixMe" which I don't understand? |
Should I share my demo code? |
I'm having the same problem with a very basic setup. Didn't have this problem with stoppable. I tested changing my code to just call the That makes this really hard to debug, so I might just switch back to stoppable to get going again. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks Eris for your input, but the conversation is derailing. Valuable contributions at this point are:
Beyond this, the bug has been described and acknowledged. |
🎉 This issue has been resolved in version 3.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
In the readme it states that http-terminator should wait for requests to finish before closing connections.
As far as I can tell, if http-terminator is set to have a long timeout, and has to handle a long-running request. It actually doesn't close until the timeout ends, even if all the requests have finished.
Reproduce:
Now to test:
See the server closes immediately
See the server doesn't close for a very long time.
I would expect that the server would close as soon as the conditions that there are 0 connections and the last request is finished are met OR after 60000ms, whichever is first.
The text was updated successfully, but these errors were encountered: