Skip to content
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

timers: timer starvation #24320

Closed
cjihrig opened this issue Nov 12, 2018 · 2 comments
Closed

timers: timer starvation #24320

cjihrig opened this issue Nov 12, 2018 · 2 comments
Labels
confirmed-bug Issues with confirmed bugs. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

Comments

@cjihrig
Copy link
Contributor

cjihrig commented Nov 12, 2018

  • Version: 11.1.0 and master. 10.x is not impacted
  • Platform: macOS
  • Subsystem: timers

The following code should exit once the 110ms timer fires. Unfortunately, that never happens. Note, I tried including #24318, and that did not fix the issue either.

'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);

Refs: hapijs/nes#257
cc: @nodejs/timers

@apapirovski
Copy link
Member

Working on a PR 😓

@Fishrock123 Fishrock123 added confirmed-bug Issues with confirmed bugs. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. labels Nov 12, 2018
Trott pushed a commit to Trott/io.js that referenced this issue Nov 15, 2018
PR-URL: nodejs#24322
Fixes: nodejs#24320
Fixes: nodejs#24362
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
@Trott
Copy link
Member

Trott commented Nov 15, 2018

Fixed in 9ca5c52

@Trott Trott closed this as completed Nov 15, 2018
BridgeAR pushed a commit that referenced this issue Nov 15, 2018
PR-URL: #24322
Fixes: #24320
Fixes: #24362
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants