SomeAverageDev / cozy-downloader

5 stars 0 forks source link

File pointer not freed after deletion #16

Closed clochix closed 7 years ago

clochix commented 7 years ago

When a file is deleted, its file descriptor stay used, so the process doesn't free the disk space.

A user downloaded a huge file that filled up its disk. Deleting the file didn't change anything, he had to restart the application.

clochix commented 7 years ago

I think the download of the file may not have ended, so the file descriptor was still in use. Maybe could you find a way to close it if writing on the disk fails or the file has been deleted.

SomeAverageDev commented 7 years ago

Hello, do we have any logs ?

clochix commented 7 years ago

Sorry, no logs (the disk was full, so the application was probably unable to log an error).

SomeAverageDev commented 7 years ago

@clochix, I think I fixed the issue, but I can't really test it on my dev env. Could you try it for me ? I updated the code, but did not change the package version for now. I will if you validate the fix