diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteCache.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteCache.java index 1fe79e16906f0b..2ad56b0239896c 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteCache.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteCache.java @@ -379,11 +379,12 @@ public ListenableFuture downloadFile( () -> { try { out.close(); - reporter.finished(); } catch (IOException e) { logger.atWarning().withCause(e).log( "Unexpected exception closing output stream after downloading %s/%d to %s", digest.getHash(), digest.getSizeBytes(), path); + } finally { + reporter.finished(); } }, directExecutor()); diff --git a/src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java b/src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java index 9a984df82213a5..ad32126995154e 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java @@ -676,7 +676,11 @@ public void afterCommand(AfterCommandEvent event) { public void downloadProgress(FetchProgress event) { maybeAddDate(); stateTracker.downloadProgress(event); - refresh(); + if (!event.isFinished()) { + refresh(); + } else { + checkActivities(); + } } @Subscribe