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

RPC service is automatically restarted on configuration change. #844

Open
dustinbyrne opened this issue Jan 23, 2025 · 0 comments
Open

RPC service is automatically restarted on configuration change. #844

dustinbyrne opened this issue Jan 23, 2025 · 0 comments
Assignees

Comments

@dustinbyrne
Copy link
Contributor

Overview

The RPC service must be capable of restarting when environment variables change, while maintaining a stable port. The frontend must be notified when the service is restarting and when it has restarted, so it can perform specific actions. With this change active, the user should no longer need to close their project after configuration changes to Navie are made.

Requirements

  1. Environment Change Detection:

    • Monitor environment variables for changes (e.g., user switches backend (Copilot, OpenAI API key, hosted), changes Copilot model, or modifies environment in settings).
    • Trigger a restart of the RPC service when a change is detected.
  2. Stable Port Maintenance:

    • Ensure the RPC service restarts using the last known port.
  3. Frontend Notification:

    • Notify the frontend when the RPC service is restarting.
    • Notify the frontend when the RPC service has restarted.

Behavior

  1. Monitoring Environment Variables:

    • Continuously monitor the environment for changes.
    • Use a debounce mechanism, if needed, to avoid multiple rapid restarts.
  2. Restarting the RPC Service:

    • When a change is detected, initiate the restart process.
    • Notify the frontend that the service is restarting.
    • Stop the current RPC service instance.
    • Start a new instance of the RPC service using the last known port.
    • If the port is unavailable, log an error and attempt to bind to a new port.
    • Notify the frontend that the service has restarted.
  3. Frontend Interaction:

    • When the service restart first initiates, notify the frontend. The frontend should respond by calling onNavieRestarting() on the Vue app. Example
    • When the service comes back up (indicated by it logging the port its listening on), the frontend is notified. The frontend should respond by calling loadNavieConfig() on the Vue app. Example
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

No branches or pull requests

2 participants