-
Notifications
You must be signed in to change notification settings - Fork 636
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
Conversation
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 can you explain the context of this fix. Which bug are you trying to fix? |
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. |
int execStateSize = procedureNode.GraphNodeList.Count; | ||
stackFrame.ExecutionStateSize = execStateSize; | ||
for (int n = execStateSize - 1; n >= 0; --n) | ||
try | ||
{ |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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
*.resx
filesReviewers
@DynamoDS/dynamo