-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
fsPromises.truncate doesn't close fd.Β #34189
Copy link
Copy link
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.
Type
Fields
Give feedbackNo fields configured for issues without a type.
What steps will reproduce the bug?
fsPromises.truncate(path) will result in a warning a few seconds later:
(node:1387179) Warning: Closing file descriptor 22 on garbage collection- Using the callback truncateawait new Promise((res, rej) => { fs.truncate(file, (err, ret) => { if(err) rej(err); else res(ret) }) })works fine without such warning.How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior?
Not having this warning.
What do you see instead?
Additional information