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
inflightRequests() doesn't decrease if an error is thrown in server.pre() #1483
Comments
Hey @seoker, We have been running into this recently as well. In fact, we have stopped using inflightRequestThrottle entirely as the It looks like you've found another case where aborting a middleware stack during the As of right now, I believe our recommendation is to avoid relying on If you need to monitor the number of active requests to the server, you can track them by incrementing on each request and decrementing on |
Hi @retrohacker, Thanks for your kindly explanation. So the |
It isn't deprecated per-say, it is just very broken. We intend to improve it, but it will require a combination of linting (ensuring At this time, the API isn't reliable so we wouldn't advise using it. Perhaps we should update docs with a warning? |
Bug Report
Restify Version
5.2.0
Node.js Version
7.10.1
Expected behaviour
The
inflightRequests()
should be decreased back to original when something inserver.pre()
break from executing middlewares.Actual behaviour
The
inflightRequests()
keep increasing each time when something break inserver.pre()
handlers.Repro case
Cause
Are you willing and able to fix this?
I am willing to fix this if I have free time to dig into the whole process through a incoming request to the end. For now, I can just point out where the issue is and have no idea where to put
_finishReqResCycle()
.The text was updated successfully, but these errors were encountered: