Skip to content

Commit 3999ae3

Browse files
committed
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.
1 parent 493e8d9 commit 3999ae3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

extensions/ql-vscode/src/query-server/server-process.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export class ServerProcess implements Disposable {
2626
this.connection.end();
2727
this.child.stdin!.end();
2828
this.child.stderr!.destroy();
29+
this.child.removeAllListeners();
2930
// TODO kill the process if it doesn't terminate after a certain time limit.
3031

3132
// On Windows, we usually have to terminate the process before closing its stdout.

0 commit comments

Comments
 (0)