You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR is to fix an issue that was introduced after merging: #9641
As per the current design, the variable "RunSettings.RunEnabled" is associated with the Run button in dynamo. When successive "RequestRun()" calls are triggered, this causes an issue because when the Run() adds a task to the scheduler, the RunEnabled flag is set to false till the execution is completed. It is then be set back to true in a different thread that triggers the "OnUpdateGraphCompleted" even upon completion of the first task. During this execution, if the "RequestRun" is triggered again by the "OnNodeModified" event, the second Run() wont be called because the RunEnabled is set to false at this state. https://github.com/reddyashish/Dynamo/blob/65dff195c657f39e82813cc38c45fd3a3695c30c/src/DynamoCore/Graph/Workspaces/HomeWorkspaceModel.cs#L337
To overcome this issue, we have used another boolean to track this and trigger the "Run()" if necessary. This is a temporary fix and should be avoided by using a separate variable that checks if the Run is enabled/disabled from external applications. Once we introduce that new variable, we can make this "RunSettings.RunEnabled" property private and not expose it outside as this keeps track of internal executions. The above solution would cause an API break, so added a TODO comment to the code to change it in 3.0. I will keep a track of this.
The reason will be displayed to describe this comment to others. Learn more.
No, because this boolean tracks if the previous run is completely executed or not. In the case, where OnUpdateGraphCompleted event is not completed, we want to trigger the next runs. In the end the executing task will be set to false.
The reason will be displayed to describe this comment to others. Learn more.
I see, since we are using ||, normal case it will just be dominated by RunSettings.RunEnabled which is always true. But once RunEnabled become false, run() can't be called at all
@reddyashish we need to make sure that although this fixes the regression introduced from your earlier fix, this PR still fixes the original issue raised by the C3D team: https://jira.autodesk.com/browse/DYN-1706. Can you verify?
@aparajit-pratap yes, I have tested this again with Revit locally as Civil3D already has a workaround for this presently. It fixes the original issue. We also have a test case to test that workflow.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This PR is to fix an issue that was introduced after merging: #9641
As per the current design, the variable "RunSettings.RunEnabled" is associated with the Run button in dynamo. When successive "RequestRun()" calls are triggered, this causes an issue because when the Run() adds a task to the scheduler, the RunEnabled flag is set to false till the execution is completed. It is then be set back to true in a different thread that triggers the "OnUpdateGraphCompleted" even upon completion of the first task. During this execution, if the "RequestRun" is triggered again by the "OnNodeModified" event, the second Run() wont be called because the RunEnabled is set to false at this state. https://github.com/reddyashish/Dynamo/blob/65dff195c657f39e82813cc38c45fd3a3695c30c/src/DynamoCore/Graph/Workspaces/HomeWorkspaceModel.cs#L337
To overcome this issue, we have used another boolean to track this and trigger the "Run()" if necessary. This is a temporary fix and should be avoided by using a separate variable that checks if the Run is enabled/disabled from external applications. Once we introduce that new variable, we can make this "RunSettings.RunEnabled" property private and not expose it outside as this keeps track of internal executions. The above solution would cause an API break, so added a TODO comment to the code to change it in 3.0. I will keep a track of this.
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@aparajit-pratap @QilongTang @mjkkirschner