diff options
-rw-r--r-- | buildstream/_scheduler/pullqueue.py | 3 | ||||
-rw-r--r-- | buildstream/element.py | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/buildstream/_scheduler/pullqueue.py b/buildstream/_scheduler/pullqueue.py index e879b4689..4cc0f8a1b 100644 --- a/buildstream/_scheduler/pullqueue.py +++ b/buildstream/_scheduler/pullqueue.py @@ -56,6 +56,9 @@ class PullQueue(Queue): if returncode != 0: return False + if not result: + element._pull_failed() + element._update_state() # Element._pull() returns True if it downloaded an artifact, diff --git a/buildstream/element.py b/buildstream/element.py index 11e27ad89..d74007b6b 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -143,6 +143,7 @@ class Element(Plugin): self.__strong_cached = None # Whether we have a cached artifact self.__remotely_cached = None # Whether we have a remotely cached artifact self.__remotely_strong_cached = None # Whether we have a remotely cached artifact + self.__pull_failed = False # Whether pull was attempted but failed self.__log_path = None # Path to dedicated log file or None self.__splits = None @@ -1370,6 +1371,11 @@ class Element(Plugin): # (bool): Whether a pull operation is pending # def _pull_pending(self): + if self.__pull_failed: + # Consider this equivalent to artifact being unavailable in + # remote cache + return False + if not self.__strong_cached and self.__remotely_strong_cached: # Pull pending using strict cache key return True @@ -1380,6 +1386,13 @@ class Element(Plugin): # No pull pending return False + # _pull_failed() + # + # Indicate that pull was attempted but failed. + # + def _pull_failed(self): + self.__pull_failed = True + # _update_state() # # Keep track of element state. Calculate cache keys if possible and |