Skip to content

Commit 2c7c0f1

Browse files
committed
TraceServer: Add an explicit foreign server check
If a foreign server is already running, the start command used to miss that and keep going, upon a yet defined server.pid. Add an isUp check now to prevent startup from proceeding, should a known foreign server be already running. Checking for server.exitCode or server.signalCode at this early startup stage couldn't fix this, because both are prematurely set as 'none', which means a running spawned server. Contributes to fixing #8. Signed-off-by: Marco Miller <marco.miller@ericsson.com>
1 parent a56e497 commit 2c7c0f1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/trace-server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ export class TraceServer {
6767
this.server = undefined;
6868
}
6969

70-
startIfStopped(context: vscode.ExtensionContext | undefined) {
70+
async startIfStopped(context: vscode.ExtensionContext | undefined) {
7171
const pid = context?.workspaceState.get(key);
7272
const stopped = !pid || pid === none;
73-
if (stopped) {
73+
const foreigner = await this.isUp();
74+
if (stopped && !foreigner) {
7475
this.start(context);
7576
}
7677
}

0 commit comments

Comments
 (0)