Add kernel restart functionality across frontend and backend#332
Open
Edwardvaneechoud wants to merge 1 commit intofeauture/kernel-implementationfrom
Open
Add kernel restart functionality across frontend and backend#332Edwardvaneechoud wants to merge 1 commit intofeauture/kernel-implementationfrom
Edwardvaneechoud wants to merge 1 commit intofeauture/kernel-implementationfrom
Conversation
Implements a "Restart Kernel" feature that allows users to recover from
runtime issues (memory leaks, hung processes, corrupted state) without
losing code or flow configuration.
Backend:
- Add RESTARTING state to KernelState enum
- Add restart_kernel() method to KernelManager that stops the container,
creates a fresh one with the same config (packages, memory/CPU limits),
and waits for health check
- Add _get_container_logs() helper for diagnostic output on restart failure
- Add POST /kernels/{kernel_id}/restart API endpoint
Frontend:
- Add "restarting" to KernelState type with spinner icon and yellow badge
- Add KernelApi.restart() method
- Add "Restart" button to KernelCard (visible when idle/executing/error)
- Add restart button to PythonScript node settings next to kernel dropdown
- Wire up restart handling in KernelManagerView and useKernelManager
- Status indicator updates in real-time (restarting -> idle)
- Error messages surface container logs on restart failure
https://claude.ai/code/session_01G7rwmj8nw9LnXdEVppxgnp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the ability to restart kernel containers while preserving their configuration. Users can now restart kernels from both the Kernel Manager view and the Python Script node editor, with visual feedback during the restart process.
Key Changes
Backend (flowfile_core)
KernelState.RESTARTINGenum value to track restart staterestart_kernel()method in kernel manager that:_get_container_logs()helper to retrieve container logs for error reporting/kernels/{kernel_id}/restartAPI endpoint with authorization checksFrontend (flowfile_frontend)
KernelStatetype support for "restarting" stateKernelApi.restart()method for API communicationrestartKernel()action inuseKernelManagercomposableImplementation Details