Remote: Use parameters instead of thread-local storage to provide tracing metadata. (Part 2)
Change RemoteCacheClient#uploadActionResult to use RemoteActionExecutionContext.
PiperOrigin-RevId: 354233348
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 59138b5..8e68aab 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
@@ -129,6 +129,7 @@
* @throws ExecException if uploading any of the action outputs is not supported
*/
public ActionResult upload(
+ RemoteActionExecutionContext context,
ActionKey actionKey,
Action action,
Command command,
@@ -142,12 +143,13 @@
resultBuilder.setExitCode(exitCode);
ActionResult result = resultBuilder.build();
if (exitCode == 0 && !action.getDoNotCache()) {
- cacheProtocol.uploadActionResult(actionKey, result);
+ cacheProtocol.uploadActionResult(context, actionKey, result);
}
return result;
}
public ActionResult upload(
+ RemoteActionExecutionContext context,
ActionKey actionKey,
Action action,
Command command,
@@ -155,7 +157,8 @@
Collection<Path> outputs,
FileOutErr outErr)
throws ExecException, IOException, InterruptedException {
- return upload(actionKey, action, command, execRoot, outputs, outErr, /* exitCode= */ 0);
+ return upload(
+ context, actionKey, action, command, execRoot, outputs, outErr, /* exitCode= */ 0);
}
private void uploadOutputs(