-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When there are at least 2 timers set by setInterval whose callback execution are longer than interval, the eventloop will be blocked. This commit fix the above bug. PR-URL: #15072 Fixes: #15068 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
1 parent
fe6829d
commit ec69f0b
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const fs = require('fs'); | ||
|
||
const t1 = setInterval(() => { | ||
common.busyLoop(12); | ||
}, 10); | ||
|
||
const t2 = setInterval(() => { | ||
common.busyLoop(15); | ||
}, 10); | ||
|
||
const t3 = setTimeout(common.mustNotCall('eventloop blocked!'), 100); | ||
|
||
setTimeout(function() { | ||
fs.stat('./nonexistent.txt', (err, stats) => { | ||
clearInterval(t1); | ||
clearInterval(t2); | ||
clearTimeout(t3); | ||
}); | ||
}, 50); |