From 9b353c67154d2d0f2786b095b81672eabd4bec32 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 16 Jul 2020 14:38:21 +0200 Subject: [PATCH] worker: set trackUnmanagedFds to true by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prevents accidental resource leaks when terminating or exiting Worker that own FDs opened through `fs.open()`. Refs: https://github.com/nodejs/node/pull/34303 PR-URL: https://github.com/nodejs/node/pull/34394 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Rich Trott Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis --- doc/api/worker_threads.md | 5 ++++- lib/internal/worker.js | 2 +- test/parallel/test-worker-track-unmanaged-fds.js | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 7162225c8b1867..db00f7e713c8e0 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -621,6 +621,9 @@ if (isMainThread) {