-
-
Notifications
You must be signed in to change notification settings - Fork 37.1k
fsPromises.truncate doesn't close fd. #34189
Copy link
Copy link
Closed
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
Description
Activity
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
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