Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some more port forwarding logging #165714

Merged
merged 1 commit into from Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
Expand Up @@ -558,13 +558,16 @@ class ProcAutomaticPortForwarding extends Disposable {
for (const value of startingCandidates) {
this.initialCandidates.add(makeAddress(value.host, value.port));
}
this.logService.debug(`ForwardedPorts: (ProcForwarding) Initial candidates set to ${startingCandidates.join(', ')}`);
}

private async forwardCandidates(): Promise<RemoteTunnel[] | undefined> {
let attributes: Map<number, Attributes> | undefined;
const allTunnels: RemoteTunnel[] = [];
this.logService.trace(`ForwardedPorts: (ProcForwarding) Attempting to forward ${this.remoteExplorerService.tunnelModel.candidates.length} candidates`);
for (const value of this.remoteExplorerService.tunnelModel.candidates) {
if (!value.detail) {
this.logService.trace(`ForwardedPorts: (ProcForwarding) Port ${value.port} missing detail`);
continue;
}

Expand All @@ -586,18 +589,22 @@ class ProcAutomaticPortForwarding extends Disposable {

const portAttributes = attributes?.get(value.port);
if (portAttributes?.onAutoForward === OnPortForward.Ignore) {
this.logService.trace(`ForwardedPorts: (ProcForwarding) Port ${value.port} is ignored`);
continue;
}
const forwarded = await this.remoteExplorerService.forward({ remote: value, source: AutoTunnelSource }, portAttributes ?? null);
if (!alreadyForwarded && forwarded) {
this.logService.trace(`ForwardedPorts: (ProcForwarding) Port ${value.port} has been forwarded`);
this.autoForwarded.add(address);
} else if (forwarded) {
this.logService.trace(`ForwardedPorts: (ProcForwarding) Port ${value.port} has been notified`);
this.notifiedOnly.add(address);
}
if (forwarded) {
allTunnels.push(forwarded);
}
}
this.logService.trace(`ForwardedPorts: (ProcForwarding) Forwarded ${allTunnels.length} candidates`);
if (allTunnels.length === 0) {
return undefined;
}
Expand Down