File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -299,8 +299,10 @@ export abstract class StdIOService<T> implements IAmDisposable {
299299 }
300300
301301 public dispose ( ) {
302+ this . logTraffic ( `Process ${ this . description } is being disposed` ) ;
302303 for ( const pid of this . additionalPidsToTerminate ) {
303304 try {
305+ this . logTraffic ( `Process ${ this . description } is terminating process ${ pid } ` ) ;
304306 process . kill ( pid ) ;
305307 } catch ( e : any ) {
306308 // TODO: Logger knows the category!
@@ -310,8 +312,20 @@ export abstract class StdIOService<T> implements IAmDisposable {
310312 }
311313 this . additionalPidsToTerminate . length = 0 ;
312314 try {
313- if ( ! this . processExited && this . process && ! this . process . killed )
315+ if ( ! this . processExited && this . process && ! this . process . killed ) {
316+ this . logTraffic ( `Process ${ this . description } is terminating the main process` ) ;
314317 this . process . kill ( ) ;
318+ } else {
319+ if ( this . processExited ) {
320+ this . logTraffic ( `Process ${ this . description } skipped terminating because it had already exited` ) ;
321+ } else if ( ! this . process ) {
322+ this . logTraffic ( `Process ${ this . description } skipped terminating because there is no process` ) ;
323+ } else if ( this . process ?. killed ) {
324+ this . logTraffic ( `Process ${ this . description } skipped terminating because it was already killed` ) ;
325+ } else {
326+ this . logTraffic ( `Process ${ this . description } skipped terminating because 🤷♂️` ) ;
327+ }
328+ }
315329 } catch ( e ) {
316330 // This tends to throw a lot because the shell process quit when we terminated the related
317331 // process above, so just swallow the error.
You can’t perform that action at this time.
0 commit comments