Skip to content

Commit

Permalink
Partially revert spack#32137
Browse files Browse the repository at this point in the history
PR spack#32137 was based on the wrong assumption that direct fetches from
mirrors are necessarily slow.

The solution (fetch the index to locally see if something is in it) is
not scalable.

Instead, there's plenty of space to improve the current s3:// fetch
logic: it shouldn't create a client every time, the number of 404s can
be halved by not trying to fetch s3://[url]/index.html if s3://[url]
responds with 404. Etc.
  • Loading branch information
haampie committed Dec 5, 2022
1 parent 534a994 commit bab4c3b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/spack/spack/binary_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ def find_by_hash(self, find_hash, mirrors_to_check=None):
mirrors_to_check: Optional mapping containing mirrors to check. If
None, just assumes all configured mirrors.
"""
if find_hash not in self._mirrors_for_spec:
# Not found in the cached index, pull the latest from the server.
self.update(with_cooldown=True)
if find_hash not in self._mirrors_for_spec:
return None
results = self._mirrors_for_spec[find_hash]
Expand Down

0 comments on commit bab4c3b

Please sign in to comment.