-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
Correctly invoke async router callback asynchronously #4891
Conversation
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.
Thanks! Please add a test case or leave in the pr a demo of the issue and we can make it in to a test case.
@dougwilson Please see the new commit |
Great, thank you! Would you be willing to open the same PR over at https://github.com/pillarjs/router ? |
@@ -203,6 +204,12 @@ proto.handle = function handle(req, res, out) { | |||
return; | |||
} | |||
|
|||
// max sync stack | |||
if (++sync > 100) { |
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.
Without looking at the current v8 stack frames, there is no way to know if you still have 100 frames left to use. Also params will add/remove to how many frames are used in each iteration, I wouldn't think. How did you come up with the number 100 for this?
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.
@dougwilson router repo already fixed it: pillarjs/router@e96ebf5 I have a new commit to fix stack overflow with a large sync stack: 538a789 |
Ah, I guess we didn't port that over, lol! Thanks for pointing that out. I'll port that commit over to 4.18 🎉 |
Sometimes this error occurs:
RangeError: Maximum call stack size exceeded
This pull request can fix the error.