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: prevent max recursion error #563

Merged
merged 1 commit into from
Oct 20, 2021
Merged

fix: prevent max recursion error #563

merged 1 commit into from
Oct 20, 2021

Conversation

jenhagg
Copy link
Collaborator

@jenhagg jenhagg commented Oct 20, 2021

Purpose

When a scenario is in the execute state and we try to create a new scenario object, there is a max recursion error. This happens because due to the following loop (rough outline):

scenario.__init__
execute.__init__
execute.refresh
launcher.__init__
scenario.scenario_id
scenario.__getattr__
self.state (in the process of being set)
scenario.__getattr__
self.state (in the process of being set)
scenario.__getattr__
etc

What the code is doing

Delay evaluation of scenario.scenario_id until after the objects are fully instantiated.

Testing

Loaded scenario 3898 which is in execute state:

  • before: max recursion error
  • after: loads successfully

Time estimate

Not sure

@kasparm kasparm self-requested a review October 20, 2021 21:31
Copy link
Contributor

@kasparm kasparm left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@jenhagg jenhagg added the bug Something isn't working label Oct 20, 2021
@jenhagg jenhagg self-assigned this Oct 20, 2021
@jenhagg jenhagg merged commit 8aa6d39 into develop Oct 20, 2021
@jenhagg jenhagg deleted the jon/overflow branch October 20, 2021 21:34
@kasparm
Copy link
Contributor

kasparm commented Oct 20, 2021

I will go ahead and run scenario 3898 and then delete it. Any other scenario in execute state can be used for testing if anybody wants to reproduce the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants