Avoid double restarts of the query server
Previously, if there was an explicit restart of the query server (eg- by changing a configuration setting), then the query server process would be started twice: once by the `close` handler and once by the restart command. By adding the `removeAllListeners` to the dispose method, we ensure that when the query server shuts down gracefully, there won't be a `close` listener that is going to restart it a second time if there is a different way of restarting it.
This commit is contained in:
@@ -26,6 +26,7 @@ export class ServerProcess implements Disposable {
|
||||
this.connection.end();
|
||||
this.child.stdin!.end();
|
||||
this.child.stderr!.destroy();
|
||||
this.child.removeAllListeners();
|
||||
// TODO kill the process if it doesn't terminate after a certain time limit.
|
||||
|
||||
// On Windows, we usually have to terminate the process before closing its stdout.
|
||||
|
||||
Reference in New Issue
Block a user