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 federated TS behavior mismatch with federated C, using intended tag from RTI for scheduling federate port action (LF issue #647) #71

Merged
merged 11 commits into from
Jan 8, 2022

Conversation

hokeun
Copy link
Member

@hokeun hokeun commented Dec 29, 2021

Issue: https://github.com/lf-lang/lingua-franca/issues/648

Fix federated TS behavior mismatch with federated C and add the first step for PTAG handling.
Right now, the PTAG handling only does reading the PTAG message correctly.

Actual semantic handling of PTAG will be implemented in the next PR to keep each PR as short as possible.

Also, please let me know if you have any suggestions for a better way not to add extra microstep for network messages.

@hokeun hokeun requested review from lhstrh and Soroosh129 December 29, 2021 06:01
@hokeun hokeun linked an issue Jan 3, 2022 that may be closed by this pull request
@hokeun hokeun changed the title Fix federated TS behavior mismatch with federated C (LF issue #647) Fix federated TS behavior mismatch with federated C, using indicated tag from RTI for scheduling federate port action (LF issue #647) Jan 7, 2022
@hokeun hokeun requested a review from edwardalee January 7, 2022 22:06
@lhstrh
Copy link
Member

lhstrh commented Jan 8, 2022

Thanks for the suggestion. I added this check in b99781d.

This fix will work for centralized coordination (where it is a hard error), but not for decentralized coordination, where it should lead to the invocation of a user-defined fault handler. We can create an issue for this and leave it out of this PR.


if (this.action.origin == Origin.logical && !(this.action instanceof Startup)) {

if (this.action.origin == Origin.logical && !(this.action instanceof Startup)
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest to put this in the else clause of the if (this.action instanceof FederatePortAction) { below (and remove the last condition from the branch predicate).

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Done in 61498a6.

Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

These changes look good. As a general comment, federation.ts could use some refactoring as some of the existing functions in there are pretty huge.

@lhstrh lhstrh self-requested a review January 8, 2022 00:49
@hokeun
Copy link
Member Author

hokeun commented Jan 8, 2022

Thanks for the suggestion. I added this check in b99781d.

This fix will work for centralized coordination (where it is a hard error), but not for decentralized coordination, where it should lead to the invocation of a user-defined fault handler. We can create an issue for this and leave it out of this PR.

Sounds good. I created a new issue here: #75

@Soroosh129
Copy link
Contributor

Soroosh129 commented Jan 8, 2022

I don't mean to nitpick, but the name of the tag field carried on timed messages is intended tag, not indicated tag.

@hokeun
Copy link
Member Author

hokeun commented Jan 8, 2022

I don't mean to nitpick, but the name of the tag field carried on timed messages is intended tag, not indicated tag.

lol not sure what happened in the beginning. Fixed the terms. Thanks for catching this.

@hokeun hokeun changed the title Fix federated TS behavior mismatch with federated C, using indicated tag from RTI for scheduling federate port action (LF issue #647) Fix federated TS behavior mismatch with federated C, using intended tag from RTI for scheduling federate port action (LF issue #647) Jan 8, 2022
@hokeun hokeun merged commit b3bafb4 into master Jan 8, 2022
@hokeun hokeun deleted the federated2 branch January 8, 2022 18:05
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.

Behavior mismatch between C and TypeScript in federated execution
4 participants