0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/src
Anatoli Papirovski 8803b69c72
async_wrap: schedule destroy hook as unref
Since the `DestroyAsyncIdsCallback` in Node.js can be scheduled as
a result of GC, that means that it can accidentally keep the event
loop open when it shouldn't.

Replace `SetImmediate` with the newly introduced `SetUnrefImmediate`
and in addition introduce RunBeforeExit callbacks, of which
`DestroyAsyncIdsCallback` is now the first. These callbacks will run
before the `beforeExit` event is emitted (which will now only be
emitted if the event loop is still not active).

PR-URL: https://github.com/nodejs/node/pull/18241
Fixes: https://github.com/nodejs/node/issues/18190
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
2018-01-21 12:39:41 -05:00
..
res
tracing
aliased_buffer.h
async_wrap-inl.h
async_wrap.cc async_wrap: schedule destroy hook as unref 2018-01-21 12:39:41 -05:00
async_wrap.h
backtrace_posix.cc
backtrace_win32.cc
base64.h
base_object-inl.h
base_object.h
cares_wrap.cc
CNNICHashWhitelist.inc
connect_wrap.cc
connect_wrap.h
connection_wrap.cc
connection_wrap.h
env-inl.h
env.cc async_wrap: schedule destroy hook as unref 2018-01-21 12:39:41 -05:00
env.h async_wrap: schedule destroy hook as unref 2018-01-21 12:39:41 -05:00
freelist.h
fs_event_wrap.cc
handle_wrap.cc
handle_wrap.h
inspector_agent.cc
inspector_agent.h
inspector_io.cc
inspector_io.h
inspector_js_api.cc
inspector_socket_server.cc
inspector_socket_server.h
inspector_socket.cc
inspector_socket.h
js_stream.cc
js_stream.h
module_wrap.cc
module_wrap.h
node_api_types.h
node_api.cc
node_api.h
node_buffer.cc
node_buffer.h
node_config.cc
node_constants.cc
node_constants.h
node_contextify.cc
node_counters.cc
node_counters.h
node_crypto_bio.cc
node_crypto_bio.h
node_crypto_clienthello-inl.h
node_crypto_clienthello.cc
node_crypto_clienthello.h
node_crypto_groups.h
node_crypto.cc
node_crypto.h
node_debug_options.cc
node_debug_options.h
node_dtrace.cc
node_dtrace.h
node_file.cc
node_file.h
node_http2_state.h
node_http2.cc
node_http2.h
node_http_parser.cc
node_i18n.cc
node_i18n.h
node_internals.h
node_javascript.h
node_lttng_provider.h
node_lttng_tp.h
node_lttng.cc
node_lttng.h
node_main.cc
node_mutex.h
node_object_wrap.h
node_os.cc
node_perf_common.h
node_perf.cc
node_perf.h
node_platform.cc
node_platform.h
node_provider.d
node_revert.h
node_root_certs.h
node_serdes.cc
node_stat_watcher.cc
node_stat_watcher.h
node_trace_events.cc
node_url.cc
node_url.h
node_util.cc
node_v8.cc
node_version.h
node_watchdog.cc
node_watchdog.h
node_win32_etw_provider-inl.h
node_win32_etw_provider.cc
node_win32_etw_provider.h
node_win32_perfctr_provider.cc
node_win32_perfctr_provider.h
node_wrap.h
node_zlib.cc
node.cc async_wrap: schedule destroy hook as unref 2018-01-21 12:39:41 -05:00
node.d
node.h
node.stp
nolttng_macros.py
noperfctr_macros.py
notrace_macros.py
pipe_wrap.cc
pipe_wrap.h
process_wrap.cc
req_wrap-inl.h
req_wrap.h
signal_wrap.cc
spawn_sync.cc
spawn_sync.h
StartComAndWoSignData.inc
stream_base-inl.h
stream_base.cc
stream_base.h
stream_wrap.cc
stream_wrap.h
string_bytes.cc
string_bytes.h
string_search.cc
string_search.h
tcp_wrap.cc
tcp_wrap.h
timer_wrap.cc
tls_wrap.cc
tls_wrap.h
tty_wrap.cc
tty_wrap.h
udp_wrap.cc
udp_wrap.h
util-inl.h
util.cc
util.h
uv.cc
v8abbr.h
v8ustack.d