Skip to content
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

Fix intial agglomerate loading #4601

Merged
merged 6 commits into from
May 13, 2020
Merged

Fix intial agglomerate loading #4601

merged 6 commits into from
May 13, 2020

Conversation

youri-k
Copy link
Contributor

@youri-k youri-k commented May 6, 2020

URL of deployed dev instance (used for testing):

Steps to test:

  • load a new agglomerate mapping
  • no black buckets should appear

Issues:


@youri-k youri-k added the backend label May 6, 2020
@youri-k youri-k requested review from fm3 and daniel-wer May 6, 2020 15:32
@youri-k youri-k self-assigned this May 6, 2020
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

Cool! Seems to do the trick, but could you explain a bit what was going on here? I’m not sure I get the change. Did the old code not wait for finishAccess? If so, why was that causing the bug? 🧐

@daniel-wer
Copy link
Member

Thanks for the quick fix @youri-k 🙏

@youri-k
Copy link
Contributor Author

youri-k commented May 7, 2020

@fm3 Tbh I'm not entirely sure, why the different position of the finishAccess() caused the bug. However, my theory is the following:
The first bucket with a new mapping is requested and the agglomerate file is not in cache. The agglomerate file is loading and the Future is not completed. When the Future is completed, there are other buckets that request the same future, which is now completed, so the backend responds to those immediately. When all other requests are finished, the original first requests get processed. However, when they try to read from the hdf5 file, it is already closed because the other reads were finished and the finishAccess() call was too early.

The only thing, I don't know is, why the file was closed after the last read because the cache should be large enough to retain it and not call removeElement().

@fm3
Copy link
Member

fm3 commented May 9, 2020

The first bucket with a new mapping is requested and the agglomerate file is not in cache. The agglomerate file is loading and the Future is not completed. When the Future is completed, there are other buckets that request the same future, which is now completed, so the backend responds to those immediately. When all other requests are finished, the original first requests get processed. However, when they try to read from the hdf5 file, it is already closed because the other reads were finished and the finishAccess() call was too early.

Okay, that sounds about right. Good catch!

The only thing, I don't know is, why the file was closed after the last read because the cache should be large enough to retain it and not call removeElement().

Maybe we can add some logging to see if items get removed from the cache earlier than we expect? This could have performance implications. That’s independent of this PR, though.

@daniel-wer daniel-wer removed their request for review May 12, 2020 16:53
@youri-k youri-k merged commit 0e99ceb into master May 13, 2020
@philippotto philippotto deleted the fix-agglomerate-cache branch June 14, 2022 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend reports existing buckets as missing when activating an agglomerate file mapping
3 participants