-
Notifications
You must be signed in to change notification settings - Fork 30k
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
http2: server.close not behaving like http1 or net #20630
Comments
Yep, able to reproduce, not sure why it's happening yet. Will investigate! |
Hmmm... I get
Something like this replicates it for me reliably though: 'use strict';
const http2 = require('http2');
const assert = require('assert');
const server = http2.createServer();
let client;
server.listen(0, function() {
client = http2.connect(`http://localhost:${server.address().port}`);
client.on('connect', function() {
console.log('connect');
});
});
server.on('session', (s) => {
s.destroy();
server.close(function() {
console.log('the close callback');
});
}); |
@apapirovski the bug is about calling |
@apapirovski it's nice it ends up being a PR that I've not finished yet. I completely forgot about that one. Thanks. |
Fixed in #19852 |
An http2 server inherits from
net.Server
, so a user might expect that the behavior ofclose()
is the same (and we document it as being the same). However, the following will never call theclose(cb)
callback.This is the same code for
net
that works as expected:The text was updated successfully, but these errors were encountered: