You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using handleUncaughtExceptions, if an error is thrown within a stream callback in the uncaughtException handler, restify enters an infinite loop. #1749
Searched both open and closed issues for duplicates of this issue
Title adequately and concisely reflects the feature or the bug
Bug Report
Restify Version
Tested on 7.7.0, almost definitely present in all versions due to underlying Node issue.
Node.js Version
v10.15.1, likely present in all versions of Node.
Expected behaviour
No infinite loop
Actual behaviour
Infinite loop
Repro case
constrestify=require('restify');consthttp=require('http');constserver=restify.createServer({handleUncaughtExceptions: true});server.on('uncaughtException',()=>{console.log('catching exception!');http.get('http://google.com',()=>{thrownewError('foobar');});});server.get('/',()=>{thrownewError('fail');});server.listen(2000,()=>console.log('Server now up on port 2000'));
There is a workaround available for this issue, which would be to change on to oncehere. If the restify team is on board with this change, I'm happy to submit a PR.