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

Query: Fixes memory leak on Windows x64 using ServiceInterop.dll #2827

Merged
merged 4 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ClientOfficialVersion>3.22.0</ClientOfficialVersion>
<ClientOfficialVersion>3.22.1</ClientOfficialVersion>
<ClientPreviewVersion>3.22.1</ClientPreviewVersion>
<ClientPreviewSuffixVersion>preview</ClientPreviewSuffixVersion>
<DirectVersion>3.22.0</DirectVersion>
<DirectVersion>3.22.2</DirectVersion>
<EncryptionVersion>1.0.0-previewV17</EncryptionVersion>
<CustomEncryptionVersion>1.0.0-preview</CustomEncryptionVersion>
<HybridRowVersion>1.1.0-preview3</HybridRowVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,7 @@ public async Task EncryptionRudItem()
}

[TestMethod]
[Ignore]
public async Task EncryptionPatchItem()
{
TestDoc docPostPatching = await MdeEncryptionTests.MdeCreateItemAsync(MdeEncryptionTests.encryptionContainer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ await containerInternal.PatchItemAsync<ToDoActivity>(
catch (CosmosException ex)
{
Assert.AreEqual(HttpStatusCode.BadRequest, ex.StatusCode);
Assert.IsTrue(ex.Message.Contains("Add Operation only support adding a leaf node of an existing node(array or object), no path found beyond: 'nonExistentParent'"), ex.Message);
Assert.IsTrue(ex.Message.Contains(@"For Operation(1): Add Operation can only create a child object of an existing node(array or object) and cannot create path recursively, no path found beyond: 'nonExistentParent'. Learn more: https:\/\/aka.ms\/cosmosdbpatchdocs"), ex.Message);
CosmosItemTests.ValidateCosmosException(ex);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ public class CustomBenchmarkConfiguration : ManualConfig

public CustomBenchmarkConfiguration(CosmosDBConfiguration configuration)
{
this.Add(JitOptimizationsValidator.DontFailOnError);
this.Add(DefaultConfig.Instance.GetLoggers().ToArray());
this.Add(StatisticColumn.P90);
this.Add(StatisticColumn.P95);
this.Add(StatisticColumn.P100);
this.Add(StatisticColumn.OperationsPerSecond);
this.Add(MarkdownExporter.Default);
this.Add(CsvExporter.Default);
this.Add(DefaultConfig.Instance.GetColumnProviders().ToArray());
this.AddValidator(JitOptimizationsValidator.DontFailOnError);
this.AddLogger(DefaultConfig.Instance.GetLoggers().ToArray());
this.AddColumn(StatisticColumn.P90);
this.AddColumn(StatisticColumn.P95);
this.AddColumn(StatisticColumn.P100);
this.AddColumn(StatisticColumn.OperationsPerSecond);
this.AddExporter(MarkdownExporter.Default);
this.AddExporter(CsvExporter.Default);
this.AddColumnProvider(DefaultConfig.Instance.GetColumnProviders().ToArray());
this.ArtifactsPath = CustomBenchmarkConfiguration.GetReportPath(configuration);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ namespace Microsoft.Azure.Cosmos.Performance.Tests.BenchmarkStrategies
using System;
using System.Collections.Generic;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Horology;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Toolchains;
using BenchmarkDotNet.Toolchains.CsProj;
using Perfolizer.Horology;

/// <summary>
/// Attribute to run the benchmark on Throughput mode.
Expand Down Expand Up @@ -49,7 +49,7 @@ public NetThroughputAttribute(BenchmarkFrameworks[] selectedFrameworks, int invo
throw new ArgumentOutOfRangeException("selectedFramework", "Not implementad BenchmarkFrameworks value.");
}

var job = Job.Default.With(toolchain).WithGcServer(true);
Job job = Job.Default.WithToolchain(toolchain).WithGcServer(true);

if (invocationCount >= 0)
{
Expand Down Expand Up @@ -84,7 +84,7 @@ public NetThroughputAttribute(BenchmarkFrameworks[] selectedFrameworks, int invo
jobs.Add(job);
}

this.Config = ManualConfig.CreateEmpty().With(jobs.ToArray());
this.Config = ManualConfig.CreateEmpty().AddJob(jobs.ToArray());
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ public class SdkBenchmarkConfiguration : ManualConfig
{
public SdkBenchmarkConfiguration()
{
this.Add(JitOptimizationsValidator.DontFailOnError);
this.Add(DefaultConfig.Instance.GetLoggers().ToArray());
this.Add(StatisticColumn.Q3);
this.Add(StatisticColumn.P80);
this.Add(StatisticColumn.P85);
this.Add(StatisticColumn.P90);
this.Add(StatisticColumn.P95);
this.Add(StatisticColumn.P100);
this.Add(new IDiagnoser[] { MemoryDiagnoser.Default, ThreadingDiagnoser.Default });
this.Add(StatisticColumn.OperationsPerSecond);
this.Add(MarkdownExporter.Default);
this.Add(CsvExporter.Default);
this.Add(DefaultConfig.Instance.GetColumnProviders().ToArray());
this.AddValidator(JitOptimizationsValidator.DontFailOnError);
this.AddLogger(DefaultConfig.Instance.GetLoggers().ToArray());
this.AddColumn(StatisticColumn.Q3);
this.AddColumn(StatisticColumn.P80);
this.AddColumn(StatisticColumn.P85);
this.AddColumn(StatisticColumn.P90);
this.AddColumn(StatisticColumn.P95);
this.AddColumn(StatisticColumn.P100);
this.AddDiagnoser(new IDiagnoser[] { MemoryDiagnoser.Default, ThreadingDiagnoser.Default });
this.AddColumn(StatisticColumn.OperationsPerSecond);
this.AddExporter(MarkdownExporter.Default);
this.AddExporter(CsvExporter.Default);
this.AddColumnProvider(DefaultConfig.Instance.GetColumnProviders().ToArray());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
"MockedItemBenchmark.ReadFeed;[Type=OfTCustom]": 571334.0,
"MockedItemBenchmark.ReadFeed;[Type=OfTWithClientTelemetryEnabled]": 565196.0,
"MockedItemBenchmark.ReadFeed;[Type=OfTWithDiagnosticsToString]": 609704.0,
"MockedItemBenchmark.ReadFeed;[Type=Stream]": 43558.0,
"MockedItemBenchmark.ReadItemExists;[Type=OfT]": 42138.0,
"MockedItemBenchmark.ReadItemExists;[Type=OfTCustom]": 41806.0,
"MockedItemBenchmark.ReadItemExists;[Type=OfTWithClientTelemetryEnabled]": 44440.0,
"MockedItemBenchmark.ReadItemExists;[Type=OfTWithDiagnosticsToString]": 78332.0,
"MockedItemBenchmark.ReadItemExists;[Type=Stream]": 34464.0,
"MockedItemBenchmark.ReadItemNotExists;[Type=OfT]": 48406.0,
"MockedItemBenchmark.ReadItemNotExists;[Type=OfTCustom]": 47406.0,
"MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 49298.0,
"MockedItemBenchmark.ReadFeed;[Type=Stream]": 39140.0,
"MockedItemBenchmark.ReadItemExists;[Type=OfT]": 38622.0,
"MockedItemBenchmark.ReadItemExists;[Type=OfTCustom]": 37992.0,
"MockedItemBenchmark.ReadItemExists;[Type=OfTWithClientTelemetryEnabled]": 39918.0,
"MockedItemBenchmark.ReadItemExists;[Type=OfTWithDiagnosticsToString]": 74370.0,
"MockedItemBenchmark.ReadItemExists;[Type=Stream]": 31018.0,
"MockedItemBenchmark.ReadItemNotExists;[Type=OfT]": 43438.0,
"MockedItemBenchmark.ReadItemNotExists;[Type=OfTCustom]": 43860.0,
"MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 45502.0,
"MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithDiagnosticsToString]": 83760.0,
"MockedItemBenchmark.ReadItemNotExists;[Type=Stream]": 42246.0,
"MockedItemBenchmark.ReadItemNotExists;[Type=Stream]": 38266.0,
"MockedItemBenchmark.UpdateItem;[Type=OfT]": 46690.0,
"MockedItemBenchmark.UpdateItem;[Type=OfTCustom]": 45532.0,
"MockedItemBenchmark.UpdateItem;[Type=OfTWithClientTelemetryEnabled]": 48372.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Compile Include="..\Microsoft.Azure.Cosmos.Tests\Utils\TextFileConcatenation.cs" Link="TextFileConcatenation.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.0.0" />
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Preview features are treated as a separate branch and will not be included in th
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### <a name="3.22.1-preview"/> [3.22.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.22.1-preview) - 2021-10-27
### <a name="3.22.1"/> [3.22.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.22.1) - 2021-10-27

#### Fixed
- [#2827](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/2827) Query: Fixes a memory leak when on Windows x64 using ServiceInterop. Introduced in 3.22.0 [2777](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/2777)

### <a name="3.22.0"/> [3.22.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.22.0) - 2021-10-18

#### Added
Expand Down
2 changes: 1 addition & 1 deletion templates/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
inputs:
command: run
projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/*.csproj'
arguments: --configuration ${{ parameters.BuildConfiguration }} /p:OS=${{ parameters.OS }} --no-restore -c Release --framework netcoreapp3.1 --allCategories=GateBenchmark -- -j Medium -m --BaselineValidation
arguments: --configuration ${{ parameters.BuildConfiguration }} /p:OS=${{ parameters.OS }} --no-restore -c Release --framework netcoreapp3.1 --allCategories=GateBenchmark -- -j Short -m --BaselineValidation
publishTestResults: true
testRunTitle: Microsoft.Azure.Cosmos.PerformanceTests

Expand Down