Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webdav: return 507 Insufficient Storage when dCache is full
Motivation: The WebDAV protocol includes a special return code to indicate that a PUT request was denied because the filesystem is full: 507 Insufficient Storage. This has the following semantics (from RFC 4918) The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request that received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action. Currently dCache returns "500 Internal Error" which provides no such semantics. Modification: Introduce a new WebDavException, InsufficientStorageException, to allow dCache to present the problem to milton. Unfortunately, PoolManager does not return sufficient information to distinguish between dCache being full and other failures; therefore, a rather ugly work-around is employed that compares the String message with known messages. Result: A full dCache results the expected 507 Insufficient Storage HTTP status. Target: master Require-notes: yes Require-book: no Request: 3.2 Request: 3.1 Request: 3.0 Request: 2.16 Patch: https://rb.dcache.org/r/10638/ Acked-by: Tigran Mkrtchyan Conflicts: modules/dcache-webdav/src/main/java/org/dcache/webdav/DcacheDirectoryResource.java
- Loading branch information
1 parent
2fd15ed
commit 1928311
Showing
4 changed files
with
44 additions
and
2 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
15 changes: 15 additions & 0 deletions
15
modules/dcache-webdav/src/main/java/org/dcache/webdav/InsufficientStorageException.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.dcache.webdav; | ||
|
||
import io.milton.resource.Resource; | ||
|
||
/** | ||
* Indicates that the server should response with status code | ||
* 507 Insufficient Storage (see RFC 4918). | ||
*/ | ||
public class InsufficientStorageException extends WebDavException | ||
{ | ||
public InsufficientStorageException(String message, Throwable cause, Resource resource) | ||
{ | ||
super(message, cause, resource); | ||
} | ||
} |