From ce932488d3b1669dcb591ea6e3efbcbc17f82286 Mon Sep 17 00:00:00 2001 From: pcloudy Date: Mon, 14 Oct 2019 02:56:57 -0700 Subject: [PATCH] Use FileSystemUtils.moveFile instead of renameTo function of Path renameTo is sometimes flaky on Windows, moveFile is a more robust implementation. Fixes https://github.com/bazelbuild/bazel/issues/9995 RELNOTES: None PiperOrigin-RevId: 274539649 --- .../com/google/devtools/build/lib/server/GrpcServerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java index 1791539ce86bf7..85db556fad771b 100644 --- a/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java +++ b/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java @@ -477,7 +477,7 @@ private void writeServerStatusFiles(InetSocketAddress address) throws IOExceptio info.writeTo(out); } Path serverInfoFile = serverDirectory.getChild(SERVER_INFO_FILE); - serverInfoTmpFile.renameTo(serverInfoFile); + FileSystemUtils.moveFile(serverInfoTmpFile, serverInfoFile); deleteAtExit(serverInfoFile); }