You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(async-rewriter2): fix interaction with domains MONGOSH-662 (#751)
The fix I previously inserted for the “Node.js prints a warning
if we intentionally disregard a rejected Promise from the generated
inner async function” problem turned out to be problematic, because
it creates an infinite loop in the domain handler system.
This problem goes away with Node.js v14.15.2 (due to
nodejs/node@0ad4f70),
but since we also support Node.js-v12.x environments
(and we would want to be resilient against changes to the
platform internals anyway), it makes sense to aim for a better
solution here.
This patch makes sure that the generated inner async function only
returns a meaningful value if its return value is actually used,
i.e. if we’re encountering an async-evaluation case where the
generated outer function actually just forwards the returned
Promise.
0 commit comments