Skip to content

Commit

Permalink
Fix agent hang on startup. (#753)
Browse files Browse the repository at this point in the history
* Adds "System.Net.HttpWebRequest.GetResponse" to the DeferInitializationOnTheseMethods list.

Removes confusing/incorrect logging message.

* Update CHANGELOG.md

* fixes grammar.
  • Loading branch information
vuqtran88 committed Oct 14, 2021
1 parent d2979b6 commit 81031ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
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

0 comments on commit 81031ac

Please sign in to comment.