-
Notifications
You must be signed in to change notification settings - Fork 407
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: add ability to stop containerless function #4025
Conversation
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.
Changes look good so far.
@mohanraj-r Is there a public facing string that you'd like me to review? Thanks! |
@sbudhirajadoc There are no new user facing strings in this PR. Just wanted to double-check if any changes need to be made to user docs e.g https://developer.salesforce.com/tools/vscode/en/functions/overview |
...de-core/src/commands/functions/forceFunctionStart/ForceFunctionContainerlessStartExecutor.ts
Outdated
Show resolved
Hide resolved
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.
QE:
- Verify TS function is killed on stop ✅
- Verify JS function is killed on stop ✅
- Verify Java function is killed on stop ✅
- Kills worked after invoke and debug ✅
Verified process killed two ones. 1. check for processes using ps (existing after start, gone after kill) 2. verified I was able to start another function (no port conflict).
…n_stop' into mohanraj-r/containerless_function_stop
@@ -19,22 +19,27 @@ import { | |||
import { ForceFunctionStartExecutor } from './ForceFunctionStartExecutor'; | |||
|
|||
export class ForceFunctionContainerlessStartExecutor extends ForceFunctionStartExecutor { | |||
private process: LocalRunProcess | undefined | void; |
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.
nit: void should encompass undefined here so I think it could just be LocalRunProcess | void
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.
Removing void results in error at this.process = await localRun.exec()
(property) ForceFunctionContainerlessStartExecutor.process: LocalRunProcess | undefined
Type 'void | LocalRunProcess' is not assignable to type 'LocalRunProcess | undefined'.
Type 'void' is not assignable to type 'LocalRunProcess | undefined'.ts(2322)
Removing undefined results in error at private process: LocalRunProcess | void;
(property) ForceFunctionContainerlessStartExecutor.process: void | LocalRunProcess
Property 'process' has no initializer and is not definitely assigned in the constructor.ts(2564)
And looks like void can't be assigned to e.g. this.process = undefined;
-> this.process = void;
results in error
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.
word. Thanks for trying.
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.
Thanks @mohanraj-r Looks good. I ran though the QE again locally and everything worked as expected. 👍
What does this PR do?
Fixes Stopping a containerless function does not kill the local process · Issue #3873 · forcedotcom/salesforcedx-vscode
What issues does this PR fix or reference?
#3873, @W-10737950@
Functionality Before
Stop Command runs successfully but the process for the function continues running.
Functionality After
Stop Command runs successfully and the underlying process for the function is not running.