Skip to content
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
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
os: Visual Studio 2019
os: Visual Studio 2022

# Build script
build_script:
Expand Down
4 changes: 2 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ var configuration = Argument<string>("configuration", "Release");
// EXTERNAL NUGET LIBRARIES
//////////////////////////////////////////////////////////////////////

#addin "Cake.FileHelpers"
#addin nuget:?package=Cake.Yaml
#addin nuget:?package=Cake.FileHelpers&version=3.1.0
#addin nuget:?package=Cake.Yaml&version=3.0.0
#addin nuget:?package=YamlDotNet&version=6.0.0

///////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ protected override async ValueTask<Outcome<TResult>> ExecuteCore<TResult, TState
// As soon as the lazy has returned a result to one thread, the concurrent request set is over, so we evict the lazy from the ConcurrentDictionary.
// We need to evict within a lock, to be sure we are not, due to potential race with new threads populating, evicting a different lazy created by a different thread.
// To reduce lock contention, first check outside the lock whether we still need to remove it (we will double-check inside the lock).
if (_collapser.TryGetValue(key, out Lazy<ValueTask<object>> currentValue))
Lazy<ValueTask<object>>? currentValue = null;
if (_collapser.TryGetValue(key, out currentValue))
{
if (currentValue == lazy)
{
await using (_lockProvider.AcquireLockAsync(key, context, context.CancellationToken, context.ContinueOnCapturedContext)
.ConfigureAwait(context.ContinueOnCapturedContext))
{
Lazy<ValueTask<object>>? valueWithinLock = null;
// Double-check that there has not been a race which updated the dictionary with a new value.
if (_collapser.TryGetValue(key, out Lazy<ValueTask<object>> valueWithinLock))
if (_collapser.TryGetValue(key, out valueWithinLock))
{
if (valueWithinLock == lazy)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<LangVersion>latest</LangVersion>
<AssemblyName>Polly.Contrib.DuplicateRequestCollapser</AssemblyName>
<RootNamespace>Polly.Contrib.DuplicateRequestCollapser</RootNamespace>
<Version>0.3.0-v030-0001</Version>
<AssemblyVersion>0.3.0.0</AssemblyVersion>
<PackageVersion>0.3.0-v030-0001</PackageVersion>
<FileVersion>0.3.0.0</FileVersion>
<InformationalVersion>0.3.0.0</InformationalVersion>
<Version>0.4.0-v040-0001</Version>
<AssemblyVersion>0.4.0.0</AssemblyVersion>
<PackageVersion>0.3.0-v040-0001</PackageVersion>
<FileVersion>0.4.0.0</FileVersion>
<InformationalVersion>0.4.0.0</InformationalVersion>
<Company>App vNext</Company>
<Copyright>Copyright (c) 2020, App vNext and contributors</Copyright>
<Description>Polly.Contrib.DuplicateRequestCollapser is a Polly policy to collapse concurrent duplicate requests to a single execution, integrating with the Polly resilience project for .NET</Description>
Expand Down Expand Up @@ -50,12 +50,16 @@
<NeutralLanguage>en-US</NeutralLanguage>
<AssemblyTitle>Polly.Contrib.DuplicateRequestCollapser</AssemblyTitle>
<PackageLicenseExpression>BSD-3-Clause</PackageLicenseExpression>
<PackageIconUrl>https://raw.github.com/App-vNext/Polly/master/Polly.png</PackageIconUrl>
<PackageIcon>package-icon.png</PackageIcon>
<PackageProjectUrl>https://github.com/Polly-Contrib/Polly.Contrib.DuplicateRequestCollapser</PackageProjectUrl>
<PackageTags>Exception Handling Resilience Transient Fault Policy Polly</PackageTags>
<PackageReleaseNotes>Custom build because the other nuget isn't getting a response from the owner</PackageReleaseNotes>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>Polly.Contrib.DuplicateRequestCollapser </Title>
<PackageId>DigitalRuby.$(AssemblyName)</PackageId>
<Authors>App vNext</Authors>
</PropertyGroup>
<ItemGroup>
<None Include="$(MsBuildThisFileDirectory)..\$(PackageIcon)" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
Binary file added src/package-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.