Profiler temp files not automatically deleted
Environment info
firebase-tools: 6.4.0
Platform: Debian 9
Steps to reproduce
Run the profiler with --raw, --no-collapse, -o <output>, and -d <duration>. Example:
firebase database:profile --no-collapse -o ./logs/example.txt --raw -d 600
Expected behavior
After completion, temporarily created files should be deleted.
Actual behavior
Temp files still exist. Screenshot of /tmp/ folder:
If/when I have some time, I'll look into the source and try to come up with a solution. If anyone else gets to it before me, then great!
This issue does not seem to follow the issue template. Make sure you provide all the required information.
For others looking into this, temporary files should be deleted as per this line. Leave a comment to let us know what you find out!
@JeremyPlease Thanks for reporting this, and sorry to hear that the CLI is causing you issues! I just ran the command you mentioned and didn't see any leftover temp files. 1 - Can you upgrade to v6.5 and try again? 2 - Can you rerun the offending command with the --debug flag enabled and post the results here? This should hopefully tell us what exactly is failing and causing this unexpected behavior
@tinaliang You're right that the tmp file should be deleted with that fs.unlinkSync call 👍
@joehan Good news and bad news.
Good: The tmp files are no longer remaining, even on v6.4.0.
Bad: I've tried a few times and can't reproduce any problems with tmp files not being deleted. The only thing that's changed is I deleted the originally reported rogue tmp files since disk space was full.
Given the source code and inability to reproduce, I think this was either a nodejs or os level issue. I'll reopen the issue if it happens again.