Commit 43a51708 authored by Julien Gilli's avatar Julien Gilli Committed by Rich Trott
Browse files

domain: error handler runs outside of its domain

Before this change, domains' error handlers would run with the
corresponding domain as the active domain. This creates the
possibility for domains' error handlers to call themselves recursively
if an event emitter created in the error handler emits an error, or if
the error handler throws an error.

This change sets the active domain to be the domain's parent (or null
if the domain for which the error handler is called has no parent) to
prevent that from happening.

Fixes: https://github.com/nodejs/node/issues/26086
PR-URL: https://github.com/nodejs/node/pull/26211


Reviewed-By: default avatarVladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent d74dc17a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment