Fix a race condition in remote cache
Previously, outerF.setExeception was set before closing the output stream of the download file when download fails. This was causing a permission error when trying to delete the file on Windows.
Fixes
RELNOTES: None
@@ -426,12 +426,13 @@ public abstract class AbstractRemoteActionCache implements AutoCloseable {
@Override
public void onFailure(Throwable t) {
- outerF.setException(t);
try {
out.close();
} catch (IOException e) {
// Intentionally left empty. The download already failed, so we can ignore
// the error on close().
+ } finally {
+ outerF.setException(t);
}
}
},
