Files
node/test/parallel
Keyhan Vakil c583508324 worker: fix stream racing with terminate
`OnStreamAfterReqFinished` uses `v8::Object::Has` to check if it needs
to call `oncomplete`. `v8::Object::Has` needs to execute Javascript.
However when worker threads are involved, `OnStreamAfterReqFinished` may
be called after the worker thread termination has begun via
`worker.terminate()`. This makes `v8::Object::Has` return `Nothing`,
which triggers an assert.

This diff fixes the issue by simply defaulting us to `false` in the case
where `Nothing` is returned. This is sound because we can't execute
`oncomplete` anyway as the isolate is terminating.

Fixes: https://github.com/nodejs/node/issues/38418

PR-URL: https://github.com/nodejs/node/pull/42874
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-07-31 09:44:06 +02:00
..
2021-09-06 08:40:01 +02:00
2021-04-29 13:45:30 +02:00
2021-05-17 09:11:30 +02:00
2022-04-20 20:34:20 -04:00
2022-04-20 20:34:18 -04:00