kitware-resonant / dkc-next

Apache License 2.0
3 stars 0 forks source link

Consider adding an API to check if a size increment would violate the quota #151

Open brianhelba opened 3 years ago

brianhelba commented 3 years ago

This would allow pre-clearing a size change without actually updating the size. This would allow more elegant validation of size changes, without having to attempt the final save.

The downside is that the check and ultimate save would need to be done atomically, as a check would not actually reserve the usage to guard against a race condition with other concurrent uploads.

See: https://github.com/girder/dkc-next/pull/145#discussion_r574010090

zachmullen commented 3 years ago

I'm not into this idea, I think EAFP is the way to go here since we'll be doing the check anyway.