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 43f9994623069a..86ecbfcca11431 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 @@ -130,6 +130,9 @@ public boolean actionCacheSupportsUpdate() { /** Upload the action result to the remote cache. */ public ListenableFuture uploadActionResult( RemoteActionExecutionContext context, ActionKey actionKey, ActionResult actionResult) { + Preconditions.checkState( + actionCacheSupportsUpdate(), + "Cannot upload action result to remote cache that does not support action cache updates"); Completable upload = RxFutures.toCompletable(