aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2018-01-09 13:52:13 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-01-09 13:54:19 -0800
commit22c2f9a7722e8c8b7fdf8f5d30a40f1c4118e993 (patch)
treec337a3e2c5f6e7ed5167d2902ff3c066002840ca /src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java
parent7f17d08d5be04d1fc393958c9895747c9dc88b30 (diff)
Automated rollback of commit 80c8ff1819a889814cbe2dae477d7fedce6aa181.
*** Reason for rollback *** Rolling forward after underlying issue has been fixed. *** Original change description *** Automated rollback of commit d50cbbeef115f28c0cea1ac17572e0f12c0cf312. *** Reason for rollback *** b/71442447 *** Original change description *** Remove synchronization from file system. After the path refactor we will no longer have path instances to synchronize on. The underlying OS file systems are already naturally thread safe, that is, their internal data structures cannot be damaged. Any further synchronization (eg. races between directory creation and deletion) has to be managed at the client level. The l... *** PiperOrigin-RevId: 181368707
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java b/src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java
index 743bf37dd0..4d47205843 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/AbstractFileSystem.java
@@ -96,18 +96,16 @@ abstract class AbstractFileSystem extends FileSystem {
@Override
protected OutputStream getOutputStream(Path path, boolean append) throws IOException {
- synchronized (path) {
- try {
- return createFileOutputStream(path, append);
- } catch (FileNotFoundException e) {
- // Why does it throw a *FileNotFoundException* if it can't write?
- // That does not make any sense! And its in a completely different
- // format than in other situations, no less!
- if (e.getMessage().equals(path + ERR_PERMISSION_DENIED)) {
- throw new FileAccessException(e.getMessage());
- }
- throw e;
+ try {
+ return createFileOutputStream(path, append);
+ } catch (FileNotFoundException e) {
+ // Why does it throw a *FileNotFoundException* if it can't write?
+ // That does not make any sense! And its in a completely different
+ // format than in other situations, no less!
+ if (e.getMessage().equals(path + ERR_PERMISSION_DENIED)) {
+ throw new FileAccessException(e.getMessage());
}
+ throw e;
}
}