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 transpose bug and handle executive revert #10656

Merged
merged 3 commits into from
May 19, 2020

Conversation

mmisol
Copy link
Collaborator

@mmisol mmisol commented May 14, 2020

Purpose

Under circumstances related to multiple node deletion in the graph
provided, the current executive of the runtime core can present a
mismatch on the value of the fepRun field. This later caused a crash
when the VM, assuming that it was calling a function endpoint, tried
to get a procedure node at an invalid index.

The cause of the this anomaly was an incorrect error handling at
JILFunctionEndPoint.Execute, where an error in a downstream call would
cause the revert of the replaced executive never to happen.

Also, the function that caused the improperly handled error is fixed.
Now the built-in transpose function should behave correctly when
provided values that are a mix of empty arrays and scalar values.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.

Reviewers

@DynamoDS/dynamo

Under circumstances related to multiple node deletion, the current
executive of the runtime core can present a mismatch on the value of
the fepRun field. This is used to indicate that an execution is part of
a function endpoint call.

This mismatch is circumvented by following a pattern already being used
in BuiltInFunctionEndpoint and other places, where an interpreter is
created, resulting in a cloned executive but with the fepRun using a
value provided in the interpreter constructor.

There is also another problem fixed here related to the built-in
transpose function not behaving correctly when provided values that are
a mix of empty arrays and scalar values.
@mmisol mmisol added the WIP label May 14, 2020
@aparajit-pratap
Copy link
Contributor

@mmisol can you explain the context of this fix. Which bug are you trying to fix?

@mmisol
Copy link
Collaborator Author

mmisol commented May 15, 2020

Hi @aparajit-pratap . First of all, just wanted to make clear this is not yet ready for review. I just created the PR to get the tests run against this branch.

This is related to internal ticket 2674. I'll be happy to share details in standup.

@mmisol mmisol changed the title [WIP] Executive fepRun mismatch on graph update Fix transpose bug and handle executive revert May 15, 2020
@mmisol mmisol removed the WIP label May 15, 2020
@mmisol mmisol requested a review from a team May 15, 2020 22:54
int execStateSize = procedureNode.GraphNodeList.Count;
stackFrame.ExecutionStateSize = execStateSize;
for (int n = execStateSize - 1; n >= 0; --n)
try
{
Copy link
Member

Choose a reason for hiding this comment

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

ahh, this PR is so much easier to review with white space changes turned off 👍

{
runtimeCore.CurrentExecutive.CurrentDSASMExec = oldDSASMExec;
if (runtimeCore.CurrentExecutive != null)
Copy link
Member

Choose a reason for hiding this comment

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

okay, I think I get it -
when transpose thew an exception (or rather any function would throw an exception - I'm curious if transpose was special in some way? or the way it failed was special?)

then this switch back to the executive which I guess represents the original calling scope is never set back and chaos ensues.

Does this sound about right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You got it @mjkkirschner ! I guess this would have happened with any exception during the lapse the executive is replaced. Now with try/finally the executive should be switched back in any case.

@mmisol mmisol merged commit 0676807 into DynamoDS:master May 19, 2020
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.

3 participants