Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

timers: fix handling of large timeouts #3607

Closed
wants to merge 1 commit into from

Conversation

bnoordhuis
Copy link
Member

Don't use the double-negate trick to coalesce the timeout argument into a
number, it produces the wrong result for very large timeouts.

Example:

setTimeout(cb, 1e10); // doesn't work, ~~1e10 == 1410065408

Don't use the double-negate trick to coalesce the timeout argument into a
number, it produces the wrong result for very large timeouts.

Example:

    setTimeout(cb, 1e10); // doesn't work, ~~1e10 == 1410065408
@isaacs
Copy link

isaacs commented Jul 5, 2012

LGTM.

@bnoordhuis
Copy link
Member Author

Landed in 0c47219.

@bnoordhuis bnoordhuis closed this Jul 5, 2012
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Dec 15, 2015
Fix node exiting due to an exception being thrown rather than emitting
an `'uncaughtException'` event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an `'uncaughtException'` event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and `--abort-on-uncaught-exception` is used.

Finally, change the behavior of --abort-on-uncaught-exception so that,
if the domain within which the error is thrown has no error handler, but
a domain further up the domains stack has one, the process will not
abort.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3654
PR-URL: nodejs/node#3654
Reviewed-By: Chris Dickinson <chris@neversaw.us>
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Dec 17, 2015
Fix node exiting due to an exception being thrown rather than emitting
an 'uncaughtException' event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an 'uncaughtException' event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and --abort-on-uncaught-exception is used.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3887
PR-URL: nodejs/node#3887
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Dec 17, 2015
Fix node exiting due to an exception being thrown rather than emitting
an 'uncaughtException' event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an 'uncaughtException' event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and --abort-on-uncaught-exception is used.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3885
PR-URL: nodejs/node#3885
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Dec 17, 2015
Fix node exiting due to an exception being thrown rather than emitting
an `'uncaughtException'` event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an `'uncaughtException'` event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and `--abort-on-uncaught-exception` is used.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3884
PR-URL: nodejs/node#3884
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Dec 18, 2015
Fix node exiting due to an exception being thrown rather than emitting
an `'uncaughtException'` event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an `'uncaughtException'` event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and `--abort-on-uncaught-exception` is used.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3884
PR-URL: nodejs/node#3884
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Jan 11, 2016
Fix node exiting due to an exception being thrown rather than emitting
an `'uncaughtException'` event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an `'uncaughtException'` event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and `--abort-on-uncaught-exception` is used.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3884
PR-URL: nodejs/node#3884
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Jan 13, 2016
Fix node exiting due to an exception being thrown rather than emitting
an `'uncaughtException'` event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an `'uncaughtException'` event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and `--abort-on-uncaught-exception` is used.

Finally, change the behavior of --abort-on-uncaught-exception so that,
if the domain within which the error is thrown has no error handler, but
a domain further up the domains stack has one, the process will not
abort.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3654
PR-URL: nodejs/node#3654
Reviewed-By: Chris Dickinson <chris@neversaw.us>
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Feb 15, 2016
Fix node exiting due to an exception being thrown rather than emitting
an 'uncaughtException' event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an 'uncaughtException' event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and --abort-on-uncaught-exception is used.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3885
PR-URL: nodejs/node#3885
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit to ibmruntimes/node that referenced this pull request Feb 15, 2016
Fix node exiting due to an exception being thrown rather than emitting
an 'uncaughtException' event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an 'uncaughtException' event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and --abort-on-uncaught-exception is used.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3887
PR-URL: nodejs/node#3887
Reviewed-By: James M Snell <jasnell@gmail.com>
jBarz pushed a commit to ibmruntimes/node that referenced this pull request Nov 4, 2016
Fix node exiting due to an exception being thrown rather than emitting
an 'uncaughtException' event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an 'uncaughtException' event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and --abort-on-uncaught-exception is used.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3885
PR-URL: nodejs/node#3885
Reviewed-By: James M Snell <jasnell@gmail.com>
jBarz pushed a commit to ibmruntimes/node that referenced this pull request Feb 16, 2017
Fix node exiting due to an exception being thrown rather than emitting
an 'uncaughtException' event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an 'uncaughtException' event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and --abort-on-uncaught-exception is used.

Fixes nodejs#3607 and nodejs#3653.

PR: nodejs#3885
PR-URL: nodejs/node#3885
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants