Skip to content
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

Server does not correctly close and delete partially uploaded files #198

Open
bain3 opened this issue Sep 15, 2024 · 2 comments
Open

Server does not correctly close and delete partially uploaded files #198

bain3 opened this issue Sep 15, 2024 · 2 comments

Comments

@bain3
Copy link

bain3 commented Sep 15, 2024

If the user aborts the upload in some way, for example by clicking the "Cancel" button during upload, the server does not correctly close the upload pipeline.

Steps to reproduce

  1. start the server in dev mode (following instructions in readme)
  2. start uploading a large file
  3. interrupt upload
  4. see that there is a file in the uploads folder (which should be normally deleted on this line)
  5. run lsof -p <pid> and see that the file is still open (this blocks automatic deletion by an external script! File does not get actually deleted from fs until the descriptor is closed...)
  6. be sad :(
@bain3
Copy link
Author

bain3 commented Sep 16, 2024

Ok I managed to create a hotfix for our instance. .pipe() does not properly propagate errors, and on top of that, the ws stream is not properly closed.

https://git.nolog.cz/NoLog.cz/send/commit/f7e889b875538d57ec95f0a5be7a5f7ca25e16db

@bain3
Copy link
Author

bain3 commented Sep 17, 2024

If you've been running send for a long time with a bit of traffic, then I recommend running fsck on the filesystem where you store files. This reclaimed multiple hundreds of gigs of disk space for us. I assume ext4 did not like all the open but deleted files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant