Skip to content

fsPromises.truncate doesn't close fd. #34189

@sheepa

Description

@sheepa

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 truncate await 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.fsIssues and PRs related to the fs subsystem / file system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions