Merged PR 98: add lock for kusto endpoint CommandAsync as ingest control commands are limited by ingest cluster capacity
add lock for kusto endpoint CommandAsync as ingest control commands are limited by ingest cluster capacity https://learn.microsoft.com/en-us/azure/data-explorer/kusto/management/capacity-policy#management-commands-throttling seen throttled exception in ingest command for kusto emulator "code": "Too many requests", "message": "Request is denied due to throttling. " "@type": "Kusto.DataNode. Exceptions.ControlCommandThrottledException
This commit is contained in:
Коммит
007d149798
|
@ -43,6 +43,7 @@ namespace CollectSFData.Kusto
|
|||
private Timer _adminIngestTimer { get; set; }
|
||||
private Timer _adminTimer { get; set; }
|
||||
private Timer _queryTimer { get; set; }
|
||||
private object _lockObj = new object();
|
||||
|
||||
public KustoEndpoint(ConfigurationOptions config)
|
||||
{
|
||||
|
@ -162,9 +163,12 @@ namespace CollectSFData.Kusto
|
|||
Log.Info($"command:{command}", ConsoleColor.Blue);
|
||||
return await _kustoTasks.TaskFunction((responseList) =>
|
||||
{
|
||||
ICslAdminProvider adminClient = CreateAdminClient();
|
||||
List<string> results = EnumerateResultsCsv(adminClient.ExecuteControlCommand(command));
|
||||
return results;
|
||||
// ingest commands are limited by cluster ingest capacity
|
||||
lock (_lockObj)
|
||||
{
|
||||
ICslAdminProvider adminClient = CreateAdminClient();
|
||||
return EnumerateResultsCsv(adminClient.ExecuteControlCommand(command));
|
||||
}
|
||||
}) as List<string>;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче