forked from distributed-system-analysis/pbench
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle ENOSPC more cleanly (distributed-system-analysis#3513)
* Handle ENOSPC more cleanly PBENCH-1239 In Pbench ops review, after staging the latest `main` and with the intent of testing the new `Tarball.extract` on a large dataset, we pushed a >7Gb `uperf` tarball. This failed with an internal error, leaving a partial tarball copy in the `ARCHIVE` controller directory, revealing several related problems: 1. The cache manager was using `shlib.copy2`, which copies the tarball from the staging area into the archive tree. Because `nginx` also caches the entire data stream, this *triples* the storage requirements to upload a tarball. 2. On copy failure, the cache manager did not delete the partial file. 3. While the initial data stream save code handled an `ENOSPC` specially, after mapping trouble in Werkzeug it was reported as a "server internal error", which is not ideal. 4. The MD5 file write was not similarly protected: and while this is a small file and `ENOSPC` is unlikely, we should be prepared to handle it gracefully. This PR changes the cache manager to use `shlib.move` (which was the original intent) to avoid a third copy of the tarball. On failure, we unlink the file. Both the initial tarball and MD5 write handle `ENOSPC` and return HTTP status 413 (request entity too large), which is not a perfect mapping but a standard error code that Werkzeug can handle.
- Loading branch information
Showing
4 changed files
with
259 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.