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 race condition pipeline #10070

Merged
merged 2 commits into from Feb 17, 2021
Merged

Fix race condition pipeline #10070

merged 2 commits into from Feb 17, 2021

Conversation

Gaya
Copy link
Contributor

@Gaya Gaya commented Feb 16, 2021

Description

This PR fixes #9341

Motivation and Context

The pipeline rule context and source code editor didn't play well together. In some instances the source code of pipeline rules was not loaded into the source code editor.

Because of the nature of how the context and source code editor were implemented it sometimes didn't work correctly.

It problem lies in the way the rule values are set on the source code editor. After debugging I came to the conclusion that the source code editor was not loaded, but the rule source had and thus wanted to update a non-existing source code editor.

This fix will trigger the context to apply the rule source on the source code editor should it load after the rule has been loaded.

I am using useState to get the desired effect. It's a bit weird, but it retriggers the effects inside the Context correctly. If we were to fix the way source code editor and the context work we'd have to refactor them to be controlled inputs instead of uncontrolled.

How Has This Been Tested?

Was tested using the reproduction steps of #9341

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@Gaya Gaya requested review from kyleknighted and a team February 16, 2021 12:09
@kmerz kmerz self-assigned this Feb 17, 2021
Copy link
Member

@kmerz kmerz left a comment

Choose a reason for hiding this comment

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

  • Code LGTM and I cannot come up with something better. 👍
  • Tested the Code thoroughly and worked on my machine ✔️

@kmerz kmerz merged commit ab2c2b6 into master Feb 17, 2021
@kmerz kmerz deleted the race-condition-pipeline branch February 17, 2021 08:21
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.

Pipeline Rule Direct Link Race Condition on load
2 participants