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

Fix agent hang on startup. #753

Merged
merged 3 commits into from
Oct 14, 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
2 changes: 2 additions & 0 deletions src/Agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] changes
### New Features
### Fixes
* Fixes issue [#754](https://github.com/newrelic/newrelic-dotnet-agent/issues/754): Agent could cause applications that use configuration builders from `Microsoft.Configuration.ConfigurationBuilders` to hang on startup. ([#753](https://github.com/newrelic/newrelic-dotnet-agent/pull/753)

### Deprecations/Removed Features

## [9.0.0] - 2021-09-16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ static bool TryInitialize(string method)
private static HashSet<string> _deferInitializationOnTheseMethods = new HashSet<string>
{
"System.Net.Http.HttpClient.SendAsync",
"System.Net.HttpWebRequest.SerializeHeaders"
"System.Net.HttpWebRequest.SerializeHeaders",
"System.Net.HttpWebRequest.GetResponse"
};

private static HashSet<string> DeferInitializationOnTheseMethods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ public AfterWrappedMethodDelegate BeforeWrappedMethod(InstrumentedMethodCall ins
//If the instrumentation indicates a desire to track this work as a separate transaction, check if this is possible
if (instrumentedMethodCall.InstrumentedMethodInfo.RequestedWrapperName == ForceNewTransansactionOnAsyncWrapperName)
{
if (!transactionAlreadyExists)
{
agent.Logger.Log(Extensions.Logging.Level.Debug, $"Ignoring request to track {name} as a separate transaction because this call is not already encapsulated within a transaction.");
}
else
if (transactionAlreadyExists)
{
trackWorkAsNewTransaction = agent.TryTrackAsyncWorkOnNewTransaction();

Expand Down