-
Notifications
You must be signed in to change notification settings - Fork 41
fix: Allow tools running in the terminal to prevent the workspace from stopping due to idling #332
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: Allow tools running in the terminal to prevent the workspace from stopping due to idling #332
Conversation
7c763bf to
3dce8f3
Compare
azatsarynnyy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
@vrubezhny |
akurinnoy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected
|
There is extremely rare case, but when |
To test it:
|
Yes, if the check for a command running happens with the less frequency that it may skip some activity events. One can configure
|
c26036f to
8967a19
Compare
|
@tolusha does the PR looks good for you? |
|
I would like to notice, that adding |
Yes, |
|
Maybe we can ignore /proc/1 as it is the main process |
ChatGPT says there are some caveats possible, like:
But probably yes - having |
…m stopping due to idling This adds support for a CLI Watcher in che-machine-exec to prevent DevWorkspace idling when long-running CLI tools are running in the terminal. The watcher is user-configurable via a '.noidle' YAML file. No admin privileges are required. How configuration is resolved: The '.noidle' file is located by searching in the following order: - A path specified by the CLI_WATCHER_CONFIG environment variable - Searching upward from the current project directory toward $PROJECTS_ROOT, looking for .noidle - Falling back to '$HOME/.noidle' (e.g. '~/.noidle') - If not found, CLI Watcher waits and checks again on the next poll Example .noidle configuration: ```yaml enabled: true watchedCommands: - helm - odo - sleep checkPeriodSeconds: 60 ``` Where: - enabled: Enables or disables the CLI watcher (boolean) - watchedCommands: List of command names to monitor - checkPeriodSeconds: Polling interval in seconds (default is 60) Benefits: - Works entirely in user space — no container or cluster admin config needed - Supports live updates (file can be added, edited, or removed while running) - Helps avoid idle timeout disconnects during long-running CLI workflows - Allows workspace authors to tailor idle behavior to specific tools Note: Some processes are always excluded from watching: - PID 1 (the main container process) - tail (typically always running in containers) Issue: eclipse-che/che#23529 Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
8967a19 to
57ae8b2
Compare
This adds support for a CLI Watcher in che-machine-exec to prevent DevWorkspace idling when long-running CLI tools are running in the terminal.
The watcher is user-configurable via a '.noidle' YAML file. No admin privileges are required.
How configuration is resolved:
The '.noidle' file is located by searching in the following order:
CLI_WATCHER_CONFIGenvironment variable$PROJECTS_ROOT, looking for.noidle$HOME/.noidle(e.g.~/.noidle)Example
.noidleconfiguration:Where:
Benefits:
Issue: eclipse-che/che#23529