"When using the detached option to start a long-running process, the process will not stay running in the background after the parent exits unless it is provided with a stdio configuration that is not connected to the parent. If the parent's stdio is inherited, the child will remain attached to the controlling terminal."
So I think options to ensure the sidecar process gets terminated would include:
1) removing the "detached" option
2) removing the "stdio" option
3) remove both
Seems like simplest would be to remove both options, which is what I've done here.
I've not currently got things set up to test this locally, so I may be mistaken. Maybe at some point I'll try to get the dev container to work...
re: the way the sidecar process keeps running in the background after exit, it looks to be related to
https://nodejs.org/api/child_process.html#optionsdetached
"When using the detached option to start a long-running process, the process will not stay running in the background after the parent exits unless it is provided with a stdio configuration that is not connected to the parent. If the parent's stdio is inherited, the child will remain attached to the controlling terminal."
So I think options to ensure the sidecar process gets terminated would include:
1) removing the "detached" option 2) removing the "stdio" option 3) remove both
Seems like simplest would be to remove both options, which is what I've done here.
I've not currently got things set up to test this locally, so I may be mistaken. Maybe at some point I'll try to get the dev container to work...