Uh oh!
There was an error while loading. Please reload this page.
perf_hooks: fix scheduling regression - #18051
Conversation
jasnell
commented
Jan 9, 2018
cc @addaleax |
Scheduling a PerformanceGCCallback should not keep the loop alive but due to the recent switch to using the native SetImmediate method, it does. Go back to using uv_async_t and add a regression test.
469ae0f to
c5cc04fCompare
addaleax
left a comment
There was a problem hiding this comment.
LGTM
I kind of feel like this would better handled eventually by allowing SetImmediate()s to be unrefed, but I guess that would require somebody to make that happen ;)
| let didCall = false; | ||
| process.on('beforeExit', () => { | ||
| assert(!didCall); | ||
| didCall = true; |
There was a problem hiding this comment.
You could just use common.mustCall() on the beforeExit handler instead of tracking via didCall, right?
There was a problem hiding this comment.
Nope, that would create an infinite loop of always doing more GC and restarting beforeExit.
jasnell
commented
Jan 9, 2018
@addaleax ... Yes, I agree that having the option of unref'ing the |
jasnell
commented
Jan 9, 2018
MylesBorins
commented
Jan 9, 2018
Failures on plinux also linuxone |
jasnell
commented
Jan 9, 2018
linux one rerun: https://ci.nodejs.org/job/node-test-commit-linuxone/11748/ |
apapirovski
commented
Jan 9, 2018
I do not believe those are related to this. Also, there were two CIs earlier that were both fully successful. This didn't need a third run. |
jasnell
commented
Jan 9, 2018
plinux rerun: https://ci.nodejs.org/job/node-test-commit-plinux/14448/ |
jasnell
commented
Jan 9, 2018
CI is looking good, I'll be getting this landed. |
Scheduling a PerformanceGCCallback should not keep the loop alive but due to the recent switch to using the native SetImmediate method, it does. Go back to using uv_async_t and add a regression test. PR-URL: nodejs#18051Fixes: nodejs#18047 Refs: nodejs#18020 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
jasnell
commented
Jan 9, 2018
Landed in ececdd3 |
Scheduling a PerformanceGCCallback should not keep the loop alive but due to the recent switch to using the native SetImmediate method, it does. Go back to using uv_async_t and add a regression test. PR-URL: nodejs#18051Fixes: nodejs#18047 Refs: nodejs#18020 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Scheduling a PerformanceGCCallback should not keep the loop alive but due to the recent switch to using the native SetImmediate method, it does. Go back to using uv_async_t and add a regression test. Backport-PR-URL: #18050 PR-URL: #18051Fixes: #18047 Refs: #18020 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
apapirovski
commented
Jan 10, 2018
Scheduling a PerformanceGCCallback should not keep the loop alive but due to the recent switch to using the native SetImmediate method, it does. Go back to using uv_async_t and add a regression test. Backport-PR-URL: #18050 PR-URL: #18051Fixes: #18047 Refs: #18020 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Scheduling a PerformanceGCCallback should not keep the loop alive but due to the recent switch to using the native SetImmediate method, it does. Go back to using uv_async_t and add a regression test. PR-URL: #18051Fixes: #18047 Refs: #18020 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Scheduling a PerformanceGCCallback should not keep the loop alive but due to the recent switch to using the native SetImmediate method, it does. Go back to using uv_async_t and add a regression test. PR-URL: #18051Fixes: #18047 Refs: #18020 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Scheduling a PerformanceGCCallback should not keep the loop alive but due to the recent switch to using the native SetImmediate method, it does. Go back to using uv_async_t and add a regression test. PR-URL: #18051Fixes: #18047 Refs: #18020 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Scheduling a
PerformanceGCCallbackshould not keep the event loop alive but due to the recent switch to using the nativeSetImmediatemethod, it does. Go back to usinguv_async_tand add a regression test.The reason this was uncovered by the
http2binding is that it takes just long enough to do the GC on all the string constants that it creates that this race condition was triggered. (I finally uncovered this when the problem went away simply by commenting outHTTP_KNOWN_HEADERS(STRING_CONSTANT)innode::http2::Initialize.)Refs: #18020
Fixes: #18047
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
perf_hooks, src