Skip to content

feat: support flame recovery#386

Merged
k82cn merged 3 commits into
xflops:mainfrom
k82cn:flm_384
Mar 25, 2026
Merged

feat: support flame recovery#386
k82cn merged 3 commits into
xflops:mainfrom
k82cn:flm_384

Conversation

@k82cn
Copy link
Copy Markdown
Contributor

@k82cn k82cn commented Mar 24, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the system's resilience by introducing a robust recovery framework. It establishes a sophisticated state machine for managing node connections, enabling the system to gracefully handle disconnections and restarts of both the Session and Executor Managers. The changes ensure that in-progress tasks are retried and system state is consistently reconciled, leading to a more stable and self-healing distributed environment.

Highlights

  • Robust Recovery Mechanism: Introduced a comprehensive recovery mechanism for Flame, addressing scenarios like Session Manager restarts, Executor Manager restarts, and connection failures. This ensures tasks eventually complete through a retry mechanism and predictable cleanup.
  • Node Connection State Machine: Implemented a State Pattern for managing node connections within the Session Manager. This state machine (Connected, Draining, Closed) handles connection lifecycle, graceful disconnections, and reconnection logic with a configurable drain timeout.
  • Executor Manager Synchronization: Enhanced the Executor Manager to report its current executor IDs during WatchNode registration. This allows the Session Manager to reconcile executor states upon reconnection, ensuring consistency and triggering local cleanup if necessary.
  • Refactored Controller and API: The Session Manager's controller and API layers were refactored to integrate the new ConnectionManager and NodeCallbacks. This centralizes node connection handling and simplifies the logic for registering, draining, and synchronizing nodes.
  • Improved Data Filtering: Updated data filtering capabilities in the storage layer for sessions, executors, and nodes, allowing for more precise queries based on state, IDs, and node names.
  • Codebase Organization: Renamed and reorganized controller modules from states to executors and introduced a new nodes module, improving clarity and maintainability of the state machine implementations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive recovery mechanism for the Flame system, primarily by implementing new state machines for node connections and node states. Key changes include refactoring session_manager/src/controller/mod.rs to replace the WatchRegistry with a new ConnectionManager that utilizes ConnectionStates (Connected, Draining, Closed) and NodeStates (Unknown, Ready, NotReady) to manage node lifecycle and stream connections. The executor_manager is updated to report its active executors during registration and to handle ExecutorList messages for reconciliation, allowing it to release local executors if the session manager has cleaned them up. New design documents (CONNECTION_STATE_MACHINE.md, RFE384-flame-recovery/FS.md) detail these recovery strategies, including scenarios for network glitches and manager restarts, and outline algorithms for executor cleanup and task retries. Minor changes include adding comments to the NodeState enum, updating Cargo.lock with new dependencies, and refining filter structs in session_manager/src/model/mod.rs. A critical issue was identified where controller/mod.rs incorrectly references a non-existent ConnectionState::Shutdown variant instead of ConnectionState::Closed, which could break the node recovery path. Additionally, a documentation inconsistency was noted in docs/designs/RFE384-flame-recovery/FS.md where the Offline state is used instead of the NotReady enum variant defined in the code.

Comment thread session_manager/src/controller/mod.rs Outdated
Comment thread docs/designs/RFE384-flame-recovery/FS.md
Signed-off-by: Klaus Ma <klausm@nvidia.com>
k82cn added 2 commits March 25, 2026 10:35
Signed-off-by: Klaus Ma <klausm@nvidia.com>
Signed-off-by: Klaus Ma <klausm@nvidia.com>
@k82cn k82cn merged commit c93baa4 into xflops:main Mar 25, 2026
6 checks passed
@k82cn k82cn deleted the flm_384 branch March 25, 2026 03:33
@k82cn k82cn mentioned this pull request Mar 25, 2026
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.

1 participant