-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
download + onlyRetrieveFromCache block #2428
Comments
.get() will block, yes. Is that what you were asking? |
So...why? I think .onlyRetrieveFromCache(true), it means that if no cache file here, then throw exception or just return null something else. |
You still need to do I/O to check the disk cache and decode the image if it's present. |
I know it need time to do I/O stuff, maybe I did not express my meaning clearly. A=.download(imageUrl).submit() my expectation: |
Ah, then start with: http://bumptech.github.io/glide/doc/debugging.html#unexpected-cache-misses. The Engine logs will tell you why there is/isn't a cache miss. |
The log is "Added to existing load ...", that's why .get() blocked. |
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions. |
load image from server, when the task is not completed, load same url request image only from cache, why second request need block wait first request complete(file down completed)? i think second request need return null. the source code from: EngineKey key = keyFactory.buildKey(model, signature, width, height, transformations, |
This prevents cases where using onlyRetrieveFromCache might block a request on an RPC if a request was already pending without onlyRetrieveFromCache being set. However, this change does now mean that it's possible a resource will be loaded from the disk cache twice simultaneously because onlyRetrieveFromCache requests are no longer deduped with normal requests. We expect this case to be rare, and the consequences are an efficiency issue rather than a correctness problem, so we're still probably better off with this change. Future work might include attempting to cancel and notify any normal requests if an onlyRetrieveFromCache requests completes with the same key will the normal request is running. Fixes bumptech#2428.
This prevents cases where using onlyRetrieveFromCache might block a request on an RPC if a request was already pending without onlyRetrieveFromCache being set. However, this change does now mean that it's possible a resource will be loaded from the disk cache twice simultaneously because onlyRetrieveFromCache requests are no longer deduped with normal requests. We expect this case to be rare, and the consequences are an efficiency issue rather than a correctness problem, so we're still probably better off with this change. Future work might include attempting to cancel and notify any normal requests if an onlyRetrieveFromCache requests completes with the same key will the normal request is running. Fixes bumptech#2428.
download image like this:
and load it onlyRetrieveFromCache at the same time:
then .get() will block
The text was updated successfully, but these errors were encountered: