-
Notifications
You must be signed in to change notification settings - Fork 33
fix: 🐛 update isRunning to check exitCode #3148
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| */ | ||
| get isRunning() { | ||
| return this.#process && !this.#process.killed; | ||
| return this.#process && this.#process.exitCode === null; |
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.
The subprocess.exitCode property indicates the exit code of the child process. If the child process is still running, the field will be null.
When the child process is terminated by a signal, subprocess.exitCode will be null and subprocess.signalCode will be set.
https://nodejs.org/api/child_process.html#class-childprocess
Is this robust enough? Is it sounds like the exitCode can be null even if the process has ended.
It looks like the exit event provides more clarity:
If the process exited, code is the final exit code of the process, otherwise null. If the process terminated due to receipt of a signal, signal is the string name of the signal, otherwise null. One of the two will always be non-null.
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.
Great catch! I will add a signalCode check here as well to better check if it is actually still running.
Description
There have been times where users try to sign out or close the boundary desktop client. If there are active sessions, a modal should appear to let the user know that closing or signing out will close those sessions. It is flaky and hard to reproduce but there are times where clicking ok in the modal does not succeed and the user is stuck in a weird state.
We have updated to check the exitCode on the process instead of killed. The killed value was not always accurate while the exitCode was.
Screenshots (if appropriate)
How to Test
Suggestion from Zed for testing purposes:
Checklist
a11y-testslabel to run a11y audit tests if neededPCI review checklist
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.