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 issue that can cause infinite recursion during full resolve #204

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

lossyrob
Copy link
Member

The collection set_self_href has specific logic that will remove and add data to the root catalog's resolved object cache. This is required so that the collection cache, which is used when merging common properties into items (a pre-1.0 STAC feature), can keep proper track of the collection that are cached by href. However, if the root link is not yet resolved, this cache swapping does not need to occur. In a situation where the root was itself a collection there was an infinite loop between resolving the root link and setting it's self href, which in turn caused the not-quite-yet-resolved root link to go through the logic again.

This fix will only swap cache instances out for collections during set_self_href for root links that have already been resolved.

It adds a version of the planet disaster data locally as test case 8, which exhibits this bug without this fix.

The collection set_self_href has specific logic that will remove and
add data to the root catalog's resolved object cache. This is required
so that the collection cache, which is used when merging common
properties into items (a pre-1.0 STAC feature), can keep proper track
of the collection that are cached by href. However, if the root link
is not yet resolved, this cache swapping does not need to occur. In a
situation where the root was itself a collection there was an infinite
loop between resolving the root link and setting it's self href, which
in turn caused the not-quite-yet-resolved root link to go through the
logic again.

This fix will only swap cache instances out for collections during
set_self_href for root links that have already been resolved.

It adds a version of the planet disaster data locally as test case 8,
which exhibits this bug without this fix.
@lossyrob lossyrob merged commit dc9e860 into develop Oct 22, 2020
@lossyrob lossyrob deleted the fix/rde/collection-set-href-recursion branch October 22, 2020 20:57
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.

1 participant