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

DM-43750: Fix crash when using NameKeyCollectionManager #993

Merged
merged 2 commits into from Apr 9, 2024

Conversation

dhirving
Copy link
Contributor

@dhirving dhirving commented Apr 8, 2024

Fix an issue where NameKeyCollectionManager would throw an exception when assigning a collection chain for a collection whose record was already in the collection cache.

This was happening because of an optimization that caused the "by key" cache to not be populated when using NameKeyCollectionManager, but some code paths assumed that both the "by name" and "by key" caches are always available. Fixed the bug by removing the optimization, ensuring the behavior is the same for all implementations.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes
  • (if changing dimensions.yaml) make a copy of dimensions.yaml in configs/old_dimensions

Copy link

codecov bot commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 88.95%. Comparing base (bc16c34) to head (8f6f177).

Files Patch % Lines
...st/daf/butler/registry/_collection_record_cache.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #993   +/-   ##
=======================================
  Coverage   88.94%   88.95%           
=======================================
  Files         341      341           
  Lines       44036    44042    +6     
  Branches     9072     9069    -3     
=======================================
+ Hits        39169    39177    +8     
+ Misses       3552     3550    -2     
  Partials     1315     1315           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

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

Looks great!

Fix an issue where NameKeyCollectionManager would throw an exception when assigning a collection chain for a collection whose record was already in the collection cache.

This was happening because of an optimization that caused the "by key" cache to not be populated when using NameKeyCollectionManager, but some code paths assumed that both the "by name" and "by key" caches are always available.  Fixed the bug by removing the optimization, ensuring the behavior is the same for all implementations.
Running these tests against both CollectionManager implementations would have caught the bug in the previous commit.
@dhirving dhirving merged commit 20e04d2 into main Apr 9, 2024
18 checks passed
@dhirving dhirving deleted the tickets/DM-43750 branch April 9, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants