Closed quintesse closed 10 years ago
On possible solution I can think of is that instead of directly using the Repository
that we got from a previous ArtifactResult
to retrieve the next artifact we still use the original repository but in the new ArtifactContext
we pass a new field searchRepository
and we set it to the one we got from the previous result.
Edit: this was basically already working like this
This way we could hopefully do a clever trick where if that preferred repository is the cache and the artifact isn't found and neither does any .missing
marker exist, it will then clear the searchRepository
field and pass on the request to the original repository.
Edit: and this is more or less what was implemented
In the end I decided it was worth it to do for 1.1. Closing.
Right now we have a
RepositoryManager.getArtifactResults(contexts)
method that can efficiently retrieve several artifacts from the same repository... too efficiently perhaps because when the cache is involved the result might actually be wrong.Imagine the following steps:
Now imagine the next query:
We need a more intelligent system to deal with this. Perhaps by storing in the cache the fact that we tried to retrieve a certain artifact before but got no result (not an error! we should definitely retry in the future if the result was an error), eg. by adding a
foo-1.0.car.missing
marker file to the repository.Edit: simplified description a bit