-
Notifications
You must be signed in to change notification settings - Fork 24
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 Unintended Action Override #490
Conversation
Could you explain how the race condition occurs, i.e. what is the sequence of events causing it. Also what exactly is this change doing? |
Well done on tracking it down BTW! |
This was a subtle bug that took quite some time to pinpoint. I suspected that a lock was missing somewhere in the process of The origin of this concurrency bug for Consider the following sequence of events: The solution was to use |
Also huge thanks to @edwardalee and @erlingrj for helping me look into this! |
Not sure why the windows tests are failing -- this seems unrelated to the change in this PR since tests are also failing in the main branch. |
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.
Wow, great catch! Indeed, using the template token is not safe, so this looks like the right fix to me!
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.
Great find Shulu! I think we can safely merge this and address Windows issues separately
|
There is another concurrency bug that is triggered probabilistically with the newly introduced test |
858885a
to
0031be2
Compare
Since the newly introduced test in lf-lang/lingua-franca#2423 has been marked as failing in lf-lang/lingua-franca#2422, the checks are passing and automatic merge was triggered. I'll start another PR for the other concurrency bug. |
This PR fixes the unintended action override when two actions are triggered at about the same time in issue #489. The bug was in
convert_C_action_to_py
, the token value in the trigger is suspectable to concurrency overrides. The solution was to use the token value in the action. The companion PR in lingua-franca is lf-lang/lingua-franca#2423