mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
add configuration for STS parallel message processing (#19279)
* add configuration for parallel processing * update setting description * vbump sts * enable feature for dev by default
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/v{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
||||||
"version": "3.0.0-release.243",
|
"version": "3.0.0-release.245",
|
||||||
"downloadFileNames": {
|
"downloadFileNames": {
|
||||||
"Windows_86": "win-x86-net6.0.zip",
|
"Windows_86": "win-x86-net6.0.zip",
|
||||||
"Windows_64": "win-x64-net6.0.zip",
|
"Windows_64": "win-x64-net6.0.zip",
|
||||||
|
|||||||
@@ -383,6 +383,11 @@
|
|||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "%mssql.ignorePlatformWarning%",
|
"description": "%mssql.ignorePlatformWarning%",
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
"mssql.parallelMessageProcessing": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "%mssql.parallelMessageProcessing%",
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -186,5 +186,6 @@
|
|||||||
"objectsListProperties.name": "Name",
|
"objectsListProperties.name": "Name",
|
||||||
|
|
||||||
"title.newTable": "New Table",
|
"title.newTable": "New Table",
|
||||||
"title.designTable": "Design"
|
"title.designTable": "Design",
|
||||||
|
"mssql.parallelMessageProcessing" : "[Experimental] Whether the requests to the SQL Tools Service should be handled in parallel. This is introduced to discover the issues there might be when handling all requests in parallel. The default value is false. Relaunch of ADS is required when the value is changed."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { ServerOptions, TransportKind } from 'vscode-languageclient';
|
|||||||
import * as Constants from './constants';
|
import * as Constants from './constants';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { getCommonLaunchArgsAndCleanupOldLogFiles, getOrDownloadServer } from './utils';
|
import { getCommonLaunchArgsAndCleanupOldLogFiles, getOrDownloadServer, getParallelMessageProcessingConfig } from './utils';
|
||||||
import { Telemetry, LanguageClientErrorHandler } from './telemetry';
|
import { Telemetry, LanguageClientErrorHandler } from './telemetry';
|
||||||
import { SqlOpsDataClient, ClientOptions } from 'dataprotocol-client';
|
import { SqlOpsDataClient, ClientOptions } from 'dataprotocol-client';
|
||||||
import { TelemetryFeature, AgentServicesFeature, SerializationFeature, AccountFeature, SqlAssessmentServicesFeature, ProfilerFeature, TableDesignerFeature, ExecutionPlanServiceFeature } from './features';
|
import { TelemetryFeature, AgentServicesFeature, SerializationFeature, AccountFeature, SqlAssessmentServicesFeature, ProfilerFeature, TableDesignerFeature, ExecutionPlanServiceFeature } from './features';
|
||||||
@@ -45,7 +45,7 @@ export class SqlToolsServer {
|
|||||||
const serverPath = await this.download(context);
|
const serverPath = await this.download(context);
|
||||||
this.installDirectory = path.dirname(serverPath);
|
this.installDirectory = path.dirname(serverPath);
|
||||||
const installationComplete = Date.now();
|
const installationComplete = Date.now();
|
||||||
let serverOptions = generateServerOptions(context.extensionContext.logPath, serverPath);
|
let serverOptions = await generateServerOptions(context.extensionContext.logPath, serverPath);
|
||||||
let clientOptions = getClientOptions(context);
|
let clientOptions = getClientOptions(context);
|
||||||
this.client = new SqlOpsDataClient(Constants.serviceName, serverOptions, clientOptions);
|
this.client = new SqlOpsDataClient(Constants.serviceName, serverOptions, clientOptions);
|
||||||
const processStart = Date.now();
|
const processStart = Date.now();
|
||||||
@@ -104,8 +104,12 @@ export class SqlToolsServer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateServerOptions(logPath: string, executablePath: string): ServerOptions {
|
async function generateServerOptions(logPath: string, executablePath: string): Promise<ServerOptions> {
|
||||||
const launchArgs = getCommonLaunchArgsAndCleanupOldLogFiles(logPath, 'sqltools.log', executablePath);
|
const launchArgs = getCommonLaunchArgsAndCleanupOldLogFiles(logPath, 'sqltools.log', executablePath);
|
||||||
|
const enableAsyncMessageProcessing = await getParallelMessageProcessingConfig();
|
||||||
|
if (enableAsyncMessageProcessing) {
|
||||||
|
launchArgs.push('--parallel-message-processing');
|
||||||
|
}
|
||||||
return { command: executablePath, args: launchArgs, transport: TransportKind.stdio };
|
return { command: executablePath, args: launchArgs, transport: TransportKind.stdio };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const configLogRetentionMinutes = 'logRetentionMinutes';
|
|||||||
const configLogFilesRemovalLimit = 'logFilesRemovalLimit';
|
const configLogFilesRemovalLimit = 'logFilesRemovalLimit';
|
||||||
const extensionConfigSectionName = 'mssql';
|
const extensionConfigSectionName = 'mssql';
|
||||||
const configLogDebugInfo = 'logDebugInfo';
|
const configLogDebugInfo = 'logDebugInfo';
|
||||||
|
const parallelMessageProcessingConfig = 'parallelMessageProcessing';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -92,6 +93,18 @@ export function getConfigTracingLevel(): string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getParallelMessageProcessingConfig(): Promise<boolean> {
|
||||||
|
const config = getConfiguration();
|
||||||
|
if (!config) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const quality = await getProductQuality();
|
||||||
|
const setting = config.inspect(parallelMessageProcessingConfig);
|
||||||
|
// For dev environment, we want to enable the feature by default unless it is set explicitely.
|
||||||
|
// Note: the quality property is not set for dev environment, we can use this to determine whether it is dev environment.
|
||||||
|
return (quality === undefined && setting.globalValue === undefined && setting.workspaceValue === undefined) ? true : config[parallelMessageProcessingConfig];
|
||||||
|
}
|
||||||
|
|
||||||
export function getLogFileName(prefix: string, pid: number): string {
|
export function getLogFileName(prefix: string, pid: number): string {
|
||||||
return `${prefix}_${pid}.log`;
|
return `${prefix}_${pid}.log`;
|
||||||
}
|
}
|
||||||
@@ -352,3 +365,8 @@ export async function getOrDownloadServer(config: IConfig, handleServerEvent?: (
|
|||||||
|
|
||||||
return serverdownloader.getOrDownloadServer();
|
return serverdownloader.getOrDownloadServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getProductQuality(): Promise<string> {
|
||||||
|
const content = await fs.readFile(path.join(vscode.env.appRoot, 'product.json'));
|
||||||
|
return JSON.parse(content?.toString())?.quality;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user