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
Recently myself and @braydonf were upgrading a project from 0.10.28 to 4.x and found something our connection tracking logic broke and was causing our server to never shutdown. When investigating I found that the server would never emit the close event even if all sockets had been destroyed.
When looking at net.js I noticed that the server._emitCloseIfDrained won't be called if the connection is missing its server property:
I found that in 0.10.x socket.server was defined, but in 4.x it was undefined. I tried to make a test case to replicate it but found I was unable to do so. Luckily @braydonf took another look at it and has managed to replicate it, and is currently tracking down exactly when breakage occurred and said he would follow up on this issue when found. Looks like so far he's narrowed it down to io.js 2.2 -> 2.3.
Okay so I've narrowed it further down and the behavior changed between the releases 2.3.1 and 2.3.2.
Here is code to reproduce:
varhttps=require('https');varfs=require('fs');varoptions={key: fs.readFileSync('./server.key'),cert: fs.readFileSync('./server.crt')};varserver=https.createServer(options,function(req,res){res.writeHead(200);res.end('hello world\n');}).listen(8111);server.on('connection',function(connection){console.log('connection.server',connection.server);// undefined in 2.3.2, and defined in 2.3.1});
Looks like the behavior changed between commit 6c61ca5 and 9180140 .
Activity
braydonf commentedon Feb 4, 2016
Okay so I've narrowed it further down and the behavior changed between the releases 2.3.1 and 2.3.2.
Here is code to reproduce:
Looks like the behavior changed between commit 6c61ca5 and 9180140 .
braydonf commentedon Feb 4, 2016
And specifically here: 9180140#diff-04c3a6bcf355f2e05e7700c1b253d475R377
braydonf commentedon Feb 4, 2016
Should also be noted that the with "http"
connection.serveris defined, so this only affects "https".mscdex commentedon Feb 5, 2016
/cc @indutny
braydonf commentedon Feb 5, 2016
Okay @unusualbob and I have worked out a test case for this here: #5106
indutny commentedon Feb 16, 2016
Looking.
net: use `_server` for internal book-keeping
indutny commentedon Feb 16, 2016
Should be fixed by #5262, thank you!
net: use `_server` for internal book-keeping
net: use `_server` for internal book-keeping
net: use `_server` for internal book-keeping
net: use `_server` for internal book-keeping