Skip to content

[WIP] Removed quota stream wrapper, allow soft quota - #7627

Closed
PVince81 wants to merge 1 commit into
masterfrom
quota-softquota
Closed

PVince81 wants to merge 1 commit into
masterfrom
quota-softquota

Conversation

@PVince81

@PVince81 PVince81 commented Mar 7, 2014

Copy link
Copy Markdown
Contributor

The quota stream wrapper was used to provide a hard quota that would
truncate files when exceeding the quota. Since we decided to go with a
soft quota, the stream wrapper isn't necessary any more.

This fixes issues where file would randomly be truncated when the quota
was almost reached, happening with encryption and could happen when
uploading multiple files from multiple sources concurrently.

Fixes #7626

Note: It is not possible to properly test this before #7624 is merged.

The quota stream wrapper was used to provide a hard quota that would
truncate files when exceeding the quota. Since we decided to go with a
soft quota, the stream wrapper isn't necessary any more.

This fixes issues where file would randomly be truncated when the quota
was almost reached, happening with encryption and could happen when
uploading multiple files from multiple sources concurrently.
@PVince81

Copy link
Copy Markdown
Contributor Author

Rebased and fixed tests

@PVince81

Copy link
Copy Markdown
Contributor Author

Please review @karlitschek @DeepDiver1975 @schiesbn @icewind1991

@icewind1991

Copy link
Copy Markdown
Contributor

👍

@PVince81

Copy link
Copy Markdown
Contributor Author

Please hold ⛔
I am working on another PR related to part files and chunking with better handling when reaching the disk free space.

Maybe it would be a better idea to check how many bytes were written by fwrite(), and if it doesn't match what was passed, a "InsufficientStorageException" is thrown that will, in the handler, delete the file that was just uploaded (or the part file).

This way the quota wrapper can keep doing what it was designed to do: simulate a fixed storage space.

@PVince81 PVince81 changed the title Removed quota stream wrapper, allow soft quota [WIP] Removed quota stream wrapper, allow soft quota Mar 21, 2014
@PVince81 PVince81 removed the Bug label Apr 10, 2014
@bantu

bantu commented Apr 30, 2014

Copy link
Copy Markdown

@PVince81 What is the definition of "Soft Quota"? I think we need to properly document the expected behaviour somewhere.

@PVince81

Copy link
Copy Markdown
Contributor Author

@MorrisJobke

Copy link
Copy Markdown
Contributor

cc @butonic

@MorrisJobke

Copy link
Copy Markdown
Contributor

@butonic @PVince81 Any news here? Can this be closed or revived?

@MorrisJobke

Copy link
Copy Markdown
Contributor

@PVince81 Ping

@PVince81

PVince81 commented Dec 8, 2015

Copy link
Copy Markdown
Contributor Author

I think we should revive this.

The quota stream wrapper doesn't make sense because:

  • it checks the free space only before starting to write, so it means that if the free space / quota changes during transfer it will not notice
  • it truncates the files if there is not enough space left, which we never want
  • it might make the streamCopy from Webdav fail, but then it could as well be made to fail earlier before we even started the transfer (the Sabre quota plugin should do that)

@PVince81

PVince81 commented Dec 8, 2015

Copy link
Copy Markdown
Contributor Author
  • and in the case where it's really the disk becoming full, the file will be truncated anyway. No need for a quota stream wrapper for that

@PVince81 PVince81 added this to the 9.1-current milestone Mar 31, 2016
@PVince81

Copy link
Copy Markdown
Contributor Author

Let's revive this for 9.1

@PVince81

Copy link
Copy Markdown
Contributor Author

Not much reason keeping this open. To be redone once we address the ticket.

@PVince81 PVince81 closed this May 13, 2016
@PVince81
PVince81 deleted the quota-softquota branch May 13, 2016 14:19
@lock

lock Bot commented Aug 5, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encryption + quota file truncation risk when reaching quota

5 participants