From 9e04070d3c97ec4dee2e970bf5ca33aeaca45ea5 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 11 Jul 2020 01:59:21 +0200 Subject: [PATCH] worker: add option to track unmanaged file descriptors Add a public option for Workers which adds tracking for raw file descriptors, as currently, those resources are not cleaned up, unlike e.g. `FileHandle`s. PR-URL: https://github.com/nodejs/node/pull/34303 Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Benjamin Gruenbaum --- doc/api/worker_threads.md | 12 ++++ lib/internal/worker.js | 3 +- src/node_worker.cc | 7 +- src/node_worker.h | 1 + .../test-worker-track-unmanaged-fds.js | 69 +++++++++++++++++++ 5 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 test/parallel/test-worker-track-unmanaged-fds.js diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 26fb12be92992c..d49f1d2e74b209 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -620,6 +620,10 @@ if (isMainThread) {