forked from dCache/dcache
-
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.
webdav: work-around Milton racy API for creating collections
Motivation: When processing a PUT request, milton checks whether parent paths exist and creates them if not. Unfortunately, this process is racy: concurrent PUTs that target the same missing directory risk concurrent createCollection method calls with the same target. If this happens all but one createCollection call will fail, resulting in the corresponding PUT requests failing. The problem is described here: miltonio/milton2#114 Modification: Add a work-around where dCache pretends the createCollection call is successful, allowing the PUT request to succeed. Result: Fix a problem where all but one requests fail, if multiple concurrent PUT requests have directories in the path that do not already exist. Target: master Requires-notes: yes Requires-book: no Request: 5.0 Request: 4.2 Request: 4.1 Request: 4.0 Request: 3.2 Patch: https://rb.dcache.org/r/11480/ Acked-by: Olufemi Adeyemi
- Loading branch information
1 parent
517279f
commit e8e5aa4
Showing
3 changed files
with
70 additions
and
1 deletion.
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
31 changes: 31 additions & 0 deletions
31
modules/dcache-webdav/src/main/java/org/dcache/webdav/MethodNotAllowedException.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,31 @@ | ||
/* dCache - http://www.dcache.org/ | ||
* | ||
* Copyright (C) 2019 Deutsches Elektronen-Synchrotron | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.dcache.webdav; | ||
|
||
import io.milton.resource.Resource; | ||
|
||
/** | ||
* Return 405 Method Not Allowed to client. | ||
*/ | ||
public class MethodNotAllowedException extends WebDavException | ||
{ | ||
public MethodNotAllowedException(String message, Throwable cause, Resource resource) | ||
{ | ||
super(message, cause, resource); | ||
} | ||
} |