Skip to content

Adding support of transient federates#2213

Open
ChadliaJerad wants to merge 163 commits into
masterfrom
transient-fed
Open

Adding support of transient federates#2213
ChadliaJerad wants to merge 163 commits into
masterfrom
transient-fed

Conversation

@ChadliaJerad

@ChadliaJerad ChadliaJerad commented Feb 20, 2024

Copy link
Copy Markdown
Collaborator

This PR replaces #1695.
The companion PR in reactor-c is lf-lang/reactor-c#358.

It implements the transient feature in the federation execution. Details of the implementation are documented in Discussion #2212.


Merged #2609

This PR builds on the centralized transient support and extends the LF federated runtime to support transient federates under decentralized coordination, where all connections are P2P and no RTI message
forwarding occurs. It also adds support for physical connections involving transient federates under centralized coordination, which are P2P connections.

Companion PR in reactor-c: #574

LF compiler (lingua-franca)

Code generation (CExtension.java)

  • lf_connect_to_federate() now takes an additional is_transient parameter. The difference in behavior is documented in the companion PR.
  • The compiler generates per-federate inbound_p2p_connection_is_transient[NUMBER_OF_FEDERATES] and outbound_p2p_connection_is_transient[NUMBER_OF_FEDERATES], so the runtime can track which outbound peers are transient.

Tests

All transient tests are under test/C/src/federated/transient/. New tests:

  • DecentralizedTransientDownstreamWithTimer.lf — transient upstream, persistent outbound, decentralized coordination.
  • DecentralizedTransientDownstreamWithTwoUpstream.lf — transient with two inbound federates (one persistent, one transient), authenticated.
  • DecentralizedTransientStatePersistence.lf — verifies that state is correctly carried across re-joins.
  • DecentralizedTransientHotSwap.lf — hot-swap of a transient federate under decentralized coordination.
  • DecentralizedTransientWithPhysicalConnection.lf
  • TransientWithPhysicalConnection.lf

Possible future improvements

  • Add an icon in the diagram for transient federates.

@ChadliaJerad ChadliaJerad changed the title Adding support of transient federates #358 Adding support of transient federates Feb 20, 2024
@ChadliaJerad ChadliaJerad added c Related to C target federated feature New feature labels Feb 20, 2024
@lhstrh lhstrh requested a review from cmnrd February 21, 2024 00:32

@edwardalee edwardalee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great! The tests are quite nice. I wonder whether they will prove flaky, since there is always a risk of the launched federates taking an indeterminate amount of time to launch. Have you seen any flaky failures?

Comment thread core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java Outdated
Comment thread core/src/main/java/org/lflang/validation/LFValidator.java Outdated
Comment thread test/C/src/federated/transient/TransientDownstreamWithTimer.lf Outdated
Comment thread test/C/src/federated/transient/TransientDownstreamWithTwoUpstream.lf Outdated
Comment thread test/C/src/federated/transient/TransientHotSwap.lf Outdated
Comment thread test/C/src/federated/transient/TransientHotSwap.lf Outdated
cmnrd
cmnrd previously requested changes Feb 22, 2024

@cmnrd cmnrd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have significant concerns about this approach, and I don't think that we should merge this lightheartedly without being clear about the benefits and the costs. See my comment in the discussion thread for an explanation.

Comment thread test/C/src/federated/transient/TransientHotSwap.lf Outdated
@ChadliaJerad

Copy link
Copy Markdown
Collaborator Author

Looks great! The tests are quite nice. I wonder whether they will prove flaky, since there is always a risk of the launched federates taking an indeterminate amount of time to launch. Have you seen any flaky failures?

I agree that there are chances of having the tests prove flaky... But I have not encountered such a case so far on my machine. As a proactive workaround, I increased the timeout in this commit 3503ee1.

@ChadliaJerad

Copy link
Copy Markdown
Collaborator Author

I have significant concerns about this approach, and I don't think that we should merge this lightheartedly without being clear about the benefits and the costs. See my comment in the discussion thread for an explanation.

Thanks for the feedback, Christian!
Further discussions are in the discussion.

@edwardalee edwardalee marked this pull request as draft February 27, 2024 14:55
@coderabbitai

coderabbitai Bot commented Jun 20, 2024

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

_p2p_connection_is_transient. Use tags instead of boolean
s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c Related to C target feature New feature federated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants