{"action":"closed","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/20630","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/20630/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/20630/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/20630/events","html_url":"https://github.com/nodejs/node/issues/20630","id":321624910,"number":20630,"title":"http2: server.close not behaving like http1 or net","user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars0.githubusercontent.com/u/52195?v=4","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"labels":[{"id":151728674,"url":"https://api.github.com/repos/nodejs/node/labels/confirmed-bug","name":"confirmed-bug","color":"fc2929","default":false},{"id":647282877,"url":"https://api.github.com/repos/nodejs/node/labels/http2","name":"http2","color":"c2e0c6","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-05-09T15:46:05Z","updated_at":"2018-05-14T15:50:57Z","closed_at":"2018-05-14T15:50:56Z","author_association":"OWNER","body":"* **Version**: 8, 9, 10, master\r\n* **Platform**: Mac OS X\r\n* **Subsystem**: http2\r\n\r\nAn http2 server inherits from `net.Server`, so a user might expect that the behavior of `close()` is the same (and we document it as being the same). However, the following will __never__ call the `close(cb)`  callback.\r\n\r\n```js\r\n'use strict';\r\n\r\nconst http2 = require('http2');\r\nconst assert = require('assert');\r\n\r\nconst server = http2.createServer();\r\nlet client;\r\n\r\nserver.listen(0, function() {\r\n  client = http2.connect(`http://localhost:${server.address().port}`);\r\n  client.on('connect', function() {\r\n    console.log('connect');\r\n\r\n    server.close(function() {\r\n      console.log('the close callback');\r\n    });\r\n  });\r\n});\r\n\r\nserver.on('session', (s) => {\r\n  s.setTimeout(10, function () {\r\n    console.log('timeout');\r\n    s.destroy();\r\n  });\r\n});\r\n```\r\n\r\nThis is the same code for `net` that works as expected:\r\n\r\n```js\r\n'use strict';\r\n\r\nconst net = require('net');\r\nconst assert = require('assert');\r\n\r\nconst server = net.createServer();\r\nlet client;\r\n\r\nserver.listen(0, function() {\r\n  client = net.connect(server.address().port);\r\n  client.on('connect', function() {\r\n    console.log('connect');\r\n\r\n    server.close(function() {\r\n      console.log('the close callback');\r\n    });\r\n  });\r\n});\r\n\r\nserver.on('connection', (s) => {\r\n  s.setTimeout(10, function () {\r\n    console.log('timeout');\r\n    s.destroy();\r\n  });\r\n});\r\n```"}}
{"actor":{"display_login":"apapirovski"}}