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

data_store: fix traceback #6607

Open
wants to merge 1 commit into
base: 8.4.x
Choose a base branch
from

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Feb 13, 2025

Traceback spotted in the wild.

Found this traceback in a scheduler log. It happened immediately after workflow restart.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included - no unreproducible
  • Changelog entry included - no unreproducible and unreported
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@oliver-sanders oliver-sanders added this to the 8.4.x milestone Feb 13, 2025
@oliver-sanders oliver-sanders self-assigned this Feb 13, 2025
@oliver-sanders oliver-sanders added bug Something is wrong :( small labels Feb 13, 2025
Comment on lines +692 to +698
workflow.tree_depth = max(
len(val)
for val in config.get_first_parent_ancestors(pruned=True).values()
]) - 1
for val in (
config.get_first_parent_ancestors(pruned=True).values()
or (1,)
)
) - 1
Copy link
Member Author

Choose a reason for hiding this comment

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

Default to a tree_depth of 0.

@dwsutherland does this make sense?

Copy link
Member

@dwsutherland dwsutherland Feb 17, 2025

Choose a reason for hiding this comment

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

Not sure how
config.get_first_parent_ancestors(pruned=True).values()
could be no value..
Maybe some sort of inheritance error:

    def get_first_parent_ancestors(self, pruned=False):
        if pruned:
            # prune non-task namespaces from ancestors dict
            pruned_ancestors = {}
            for key, val in self.runtime['first-parent ancestors'].items():
                if key not in self.taskdefs:
                    continue
                pruned_ancestors[key] = val
            return pruned_ancestors
        else:
            return self.runtime['first-parent ancestors']
        for name in self.cfg['runtime']:
            try:
                self.runtime['linearized ancestors'][name] = c3.mro(name)
                self.runtime['first-parent ancestors'][name] = (
                    c3_single.mro(name))
            except RecursionError:
                raise WorkflowConfigError(
                    "circular [runtime] inheritance?"
                ) from None
            except Exception as exc:
                # catch inheritance errors
                # TODO - specialise MRO exceptions
                raise WorkflowConfigError(str(exc)) from None

I assume it's always 1 minimum otherwise (root)...

This fix makes sense as a workaround...

@oliver-sanders oliver-sanders marked this pull request as ready for review February 19, 2025 11:05
@oliver-sanders
Copy link
Member Author

Ok, we don't know why this is happening, but it's easy enough to defend against.

@oliver-sanders oliver-sanders modified the milestones: 8.4.x, 8.4.2 Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :( small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants