-
Notifications
You must be signed in to change notification settings - Fork 88
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
Breaks on node 11 #257
Comments
This appears to be a timers bug in Node core. On my machine (macOS), Node 11.1.0 and latest Node master branch (Node 10 is not impacted), the following command just hangs:
The I've been able to reproduce this without 'use strict';
const Hapi = require('hapi');
const Nes = require('./');
async function main() {
const server = Hapi.server();
await server.register({
plugin: Nes,
options: {
auth: false,
heartbeat: { interval: 50, timeout: 45 }
}
});
server.route({
method: 'GET',
path: '/',
handler: async () => {
await wait(110);
return 'hello';
}
});
await server.start();
const client = new Nes.Client('http://localhost:' + server.info.port);
await client.connect();
await client.request('/');
client.disconnect();
await server.stop();
}
setTimeout(() => {}, 1000);
main();
function wait(timeout) {
return new Promise((resolve) => {
setTimeout(resolve, timeout);
});
}; EDIT: Potential reproduction using only Node core: 'use strict';
let client = null;
function serverBeat() {
setTimeout(() => {}, 45);
setTimeout(serverBeat, 50);
clientBeat();
}
function clientBeat() {
clearTimeout(client);
client = setTimeout(clientBeat, 95);
}
setTimeout(() => {}, 10000);
setTimeout(serverBeat, 50);
setTimeout(() => {}, 120000);
clientBeat();
setTimeout(() => {
console.log('finished!');
process.exit();
}, 110); |
Opened nodejs/node#24320. |
@hueniverse this should be fixed in Node 11.2.0, which was just released. The nes test suite passes for me locally on 11.2.0. |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
I removed node 11 from travis until this is resolved.
@cjihrig can you also take a look?
The text was updated successfully, but these errors were encountered: