Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/buildstream/sandbox/_sandboxremote.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def run_remote_command(self, action_digest):

stub = self.exec_remote.exec_service
request = remote_execution_pb2.ExecuteRequest(
instance_name=self.exec_remote.instance_name, action_digest=action_digest, skip_cache_lookup=False
instance_name=self.exec_remote.instance_name, action_digest=action_digest, skip_cache_lookup=True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to always skip cache lookup. If no action-service-cache is declared, internal action cache lookup by the remote execution server should still be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, even when the action-cache-service is defined, there is still value in having the execution re-do cache lookup (in case the action is requested and built by someone else before our action reaches the top of the queue).

You're right that this is probably working around a "broken" remote execution server. I've only tested it with buildbox-casd, and wasn't aware it was different with other servers.

)

def __run_remote_command(stub, execute_request=None, running_operation=None):
Expand Down Expand Up @@ -346,10 +346,14 @@ def _check_action_cache(self, action_digest):
if e.code() != grpc.StatusCode.NOT_FOUND:
raise SandboxError("Failed to query action cache: {} ({})".format(e.code(), e.details()))
return None
else:
context = self._get_context()
context.messenger.info("Action result found in action cache", element_name=self._get_element_name())
return result

context = self._get_context()
if result.exit_code:
context.messenger.info("Ignoring failed action result found in action cache", element_name=self._get_element_name())
return None

context.messenger.info("Action result found in action cache", element_name=self._get_element_name())
return result

@staticmethod
def _extract_action_result(operation):
Expand Down
Loading