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 delay/hang when resolving deep dictionary dependencies #3460

Merged
merged 3 commits into from
May 27, 2024

Conversation

benclifford
Copy link
Collaborator

Description

Prior to this PR, the dict part of DEEP_DEPENDENCY_RESOLVER did not extract all futures that it should in the gather stage, meaning that sometimes the unwrap stage would happen too early. Prior to this PR, only keys and values of a dict that were directly Future objects would be waited for by the DFK, rather than deep-recursing into those key/value objects. This would result in Future.result() happening too early (and blocking, potentially forever).

This PR switches out that behaviour to call deep_traverse_to_gather recursively, instead of using an if.

This PR adds a test case which demonstrates this change. That test case will hang without the above change, but pass with this change.

This PR adds asserts to the code that unwraps Future objects, to assert that the future object is in a suitable state for immediate unwrapping (i.e. that it is done()). This changes the above bug from a hang into a dependency failure that is reported to the user, and because it happens in any unwrapping of Future objects, is probably useful in the future to anyone modifying on the deep dependency resolver.

Type of change

  • Bug fix

…hich hangs - rather than even giving an error directly
these turn hang of previous test into a test failure
Copy link
Collaborator

@khk-globus khk-globus left a comment

Choose a reason for hiding this comment

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

Subtle.

@benclifford benclifford merged commit 146a6af into master May 27, 2024
6 checks passed
@benclifford benclifford deleted the benc-dep-deep-dict branch May 27, 2024 07:53
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.

2 participants