-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable HttpClient's timeout for Standard Resilience and Hedging (#5363)
* Fixes #4924 and #4770 Disables HttpClient Timeout for standard resilience and hending handlers * Fixes #4924 Adds a note mentioning requirements on the Grpc.Net.ClientFactory version to avoid issues with the M.E.Http.Resilience package * Fixes #4924 Added a target that notifies users that they use a version of the Grpc.Net.ClientFactory package that might cause the #4924 issue * Fixes #4924 Revert changes to the Directory.Build.targets * Fixes #4924 Adds a target that checks whether M.E.Http.Resilience package is used together with Grpc.Net.ClientFactory 2.64.0 or later. If not the target warns a user. * Fixes #4924 Adds a Known issues section to the doc describing the issue with Grpc.Net.ClientFactory * Fixes #4924 * Moves the contents of the .props file into the .targets file * For net462 we now import the contents of the .targets file instead of setting it as a CDATA value in the .csproj file * Fixes #4924 Replaces the name of the project file with the MSBuildProjectName variable * Fixes #4924 * Add conditions to pack buildTransitive .targets for net462 only when net462 is included as a target framework * Changed the documentation link to the learn.microsoft.com site * Fixes #4924 * Applies editorial changes to the Known issues section * Fixes #4924 * Changes the level of the compatibility log messages from Error to Warning * Updates the logic of copying buildTransitive files * Removed extra spaces * Applied suggestions to update the documentation * Removed locale from the URL
- Loading branch information
1 parent
858624b
commit 2739017
Showing
9 changed files
with
152 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...t.Extensions.Http.Resilience/buildTransitive/Microsoft.Extensions.Http.Resilience.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<_GrpcNetClientFactory>Grpc.Net.ClientFactory</_GrpcNetClientFactory> | ||
<_CompatibleGrpcNetClientFactoryVersion>2.64.0</_CompatibleGrpcNetClientFactoryVersion> | ||
<_GrpcNetClientFactoryVersionIsIncorrect>Grpc.Net.ClientFactory 2.63.0 or earlier could cause issues when used together with Microsoft.Extensions.Http.Resilience. For more details, see https://learn.microsoft.com/dotnet/core/resilience/http-resilience#known-issues. Consider using Grpc.Net.ClientFactory $(_CompatibleGrpcNetClientFactoryVersion) or later. To suppress the warning set SuppressCheckGrpcNetClientFactoryVersion=true.</_GrpcNetClientFactoryVersionIsIncorrect> | ||
</PropertyGroup> | ||
|
||
<!-- | ||
Check whether the project is referencing Grpc.Net.ClientFactory 2.64.0 or later. | ||
If the vesion is earlier warn the user to update. | ||
See https://learn.microsoft.com/en-us/dotnet/core/resilience/http-resilience#known-issues for more details. | ||
--> | ||
<Target Name="_CheckGrpcNetClientFactoryVersion" | ||
BeforeTargets="ResolveReferences" | ||
Condition=" '$(SuppressCheckGrpcNetClientFactoryVersion)' != 'true' "> | ||
<ItemGroup> | ||
<!-- Find the package in the .csproj file. --> | ||
<_GrpcNetClientFactoryPackageReference Include="@(PackageReference)" Condition=" '%(PackageReference.Identity)' == '$(_GrpcNetClientFactory)' " /> | ||
|
||
<!-- Find the version of the package in the Central Package Source. The solution uses the Central Package Management. --> | ||
<_GrpcNetClientFactoryPackageVersion Include="@(PackageVersion)" Condition=" '%(PackageVersion.Identity)' == '$(_GrpcNetClientFactory)' " /> | ||
|
||
<!-- The package is added to the project as a transitive dependency. --> | ||
<_GrpcNetClientFactoryTransitiveDependency Include="@(ReferencePath)" Condition=" '%(ReferencePath.NuGetPackageId)' == '$(_GrpcNetClientFactory)' " /> | ||
</ItemGroup> | ||
|
||
<!-- The version of the package is included in the .csproj file. --> | ||
<Warning Condition=" @(_GrpcNetClientFactoryPackageReference->Count()) > 0 | ||
AND '%(_GrpcNetClientFactoryPackageReference.Version)' != '' | ||
AND $([MSBuild]::VersionLessThan('%(_GrpcNetClientFactoryPackageReference.Version)', '$(_CompatibleGrpcNetClientFactoryVersion)')) " | ||
Text="$(_GrpcNetClientFactoryVersionIsIncorrect)" /> | ||
|
||
<!-- The solution uses the Central Package Management and the version of the package is overridden in the .csproj file using the VersionOverride property. --> | ||
<Warning Condition=" '$(ManagePackageVersionsCentrally)' == 'true' | ||
AND @(_GrpcNetClientFactoryPackageReference->Count()) > 0 | ||
AND '%(_GrpcNetClientFactoryPackageReference.VersionOverride)' != '' | ||
AND $([MSBuild]::VersionLessThan('%(_GrpcNetClientFactoryPackageReference.VersionOverride)', '$(_CompatibleGrpcNetClientFactoryVersion)')) " | ||
Text="$(_GrpcNetClientFactoryVersionIsIncorrect)" /> | ||
|
||
<!-- The solution uses the Central Package Management and the version of the package is included in the Central Package Source. --> | ||
<Warning Condition=" '$(ManagePackageVersionsCentrally)' == 'true' | ||
AND @(_GrpcNetClientFactoryPackageReference->Count()) > 0 | ||
AND '%(_GrpcNetClientFactoryPackageVersion.Version)' != '' | ||
AND $([MSBuild]::VersionLessThan('%(_GrpcNetClientFactoryPackageVersion.Version)', '$(_CompatibleGrpcNetClientFactoryVersion)')) " | ||
Text="$(_GrpcNetClientFactoryVersionIsIncorrect)" /> | ||
|
||
<!-- This condition handles a case when the package is added to the project as a transitive dependency. --> | ||
<Warning Condition=" @(_GrpcNetClientFactoryPackageReference->Count()) == 0 | ||
AND @(_GrpcNetClientFactoryTransitiveDependency->Count()) > 0 | ||
AND '%(_GrpcNetClientFactoryTransitiveDependency.NuGetPackageVersion)' != '' | ||
AND $([MSBuild]::VersionLessThan('%(_GrpcNetClientFactoryTransitiveDependency.NuGetPackageVersion)', '$(_CompatibleGrpcNetClientFactoryVersion)')) " | ||
Text="$(_GrpcNetClientFactoryVersionIsIncorrect)" /> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters