-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs.rmSync() not releasing file handles #39946
Comments
This comment was marked as spam.
This comment was marked as spam.
@andrewhodel I'm curious, does it happen if you do something like:
|
This comment was marked as spam.
This comment was marked as spam.
@andrewhodel I'm sorry that you're feeling frustrated. It's relevant because it helps isolate the problem to whether it's happening only in the synchronous code path, or if it's a systemic issue with both implementations. |
This comment was marked as spam.
This comment was marked as spam.
@andrewhodel I understand you're frustrated. But please understand that Node.js is open source and worked on by volunteers. I'm taking time out of my own busy work schedule to triage this bug. The following code does not reproduce for me on OSX: const fs = require('fs')
fs.rmSync('foo.txt');
setInterval(function() {
console.log('l');
}, 5000); So the behavior must be cropping up only in some environments. #39853 describes similar behavior, also on GNU/Linux. @andrewhodel in your case, does the file handle also release after the process exits? |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
@andrewhodel I'm afraid no updates, I'll do my best to submit a failing test shortly, so we have a starting point. My hope is the issue crops up in at least one of Node.js' test environments. |
This comment was marked as spam.
This comment was marked as spam.
@andrewhodel this could definitely help me debug 👍 before I bother you to do so though, let me write a test that reproduces it, and we can see if it happens in any of the test environments (then we know we've squashed the issue once that test starts passing). |
@andrewhodel is there a docker container we could perhaps use alternatively? then I can try pulling it locally and reproducing. |
This comment was marked as spam.
This comment was marked as spam.
I will update this thread when I've written a failing test, I'll aim for later this week 👍 (I have Thursday mornings carved out for OSS work). |
@andrewhodel I tested with Amazon's lambda base image and unfortunately it didn't reproduce, this is the container I'm running:
One thing that jumped out at me, I notice in your sample code does not ReferenceError: fs is not defined When executing the script. How do you execute the sample code you shared?
|
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
@andrewhodel unfortunately have no cycles to work on this. If you made an instance I could SSH into, I would take a look. The problem is, I can't guarantee it won't take me a couple weeks; and I don't want you to be running up an EC2 bill. |
This comment has been minimized.
This comment has been minimized.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Hey - I am happy the issue is resolved - in the future I would appreciate if you please don't leave these sort of comments in the project :) Feel free to self-moderate that comment and I'll delete this one. |
Version
v14.15.4
Platform
Linux ip-10-0-165-79.ec2.internal 4.14.238-182.422.amzn2.x86_64 #1 SMP Tue Jul 20 20:35:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
fs
What steps will reproduce the bug?
node process.js
sudo lsof +L1
How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior?
I would expect that fs.rmSync() would release the file handle.
What do you see instead?
The file handle remains open and as such
du
reports less disk space being used thatdf
.Additional information
No response
The text was updated successfully, but these errors were encountered: