-
Notifications
You must be signed in to change notification settings - Fork 865
System.Net.Http.Headers.HttpHeaders.ReadStoreValues exception after .NET6 upgrade #1940
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
Comments
Most probably related to dotnet/runtime#61798. |
The underlying cause is certainly the same, the question is just which component is causing it in your setup. @rui-ktei Are you using NewRelic for monitoring your application? If so, this is known issue that was likely fixed in the 9.2.0 release of their .NET agent. FWIW, I looked through some of the code using HttpClient in this repo and did not spot behavior that would cause this. |
@MihaZupan thank you for the information. Yes I do use NewRelic to trace my application. I didn’t realise this was caused by that because the stack track is purely from DynamoDB. Let me update NR to latest and try again. |
@MihaZupan so I checked my project again: it does have indirect NewRelic.Agent package reference. It's indirect because it references it through another package which references NewRelic. That being said, my project does not use anything in NewRelic.Agent package. There is no However, I still updated NewRelic.Agent to the latest version anyway but I still get the same errors after that. If you look at the stacktrace I provided, it actually comes directly from DynamoDB as well. There is no magic behind it, we were simply invoking Looking at the code, I do have some calls to DynamoDB running parallelly, and it looks like this: var task1 = _dynamoDb.LoadAsync<T1>(...);
var task2 = _dynamoDb.LoadAsync<T2>(...);
await Task.WhenAll(task1, task2); Could this be the issue? If under the hood, AWS SDK is using the same HttpClient instance from the pool, then this is the only code I think could lead to thread-safety issue |
HttpClient is safe to use concurrently. In fact, we encourage it. The issue here is that the headers from the same response message are being read concurrently. You don't necessarily need any new relic code in your project. They offer instrumentations that hook into every process on a given host machine. |
@MihaZupan I see what you mean now. Thank you for the reply. We do use NewRelic .NET APM. Let me check that. I will get back to you. |
Closing this for now. It's highly likely this is NewRelic issue. We're going to update to latest version of NR and check it again. Thank you for all your help guys! |
|
Description
Reproduction Steps
Sorry I can't produce detailed steps because it doesn't happen all the time, but when it happens, the stacktrace is like below. This started to happen after we upgraded to .NET6. I'm not really sure this is .NET6 problem or a bug in DynamoDB SDK which was only made occur after .NET6. I did google a bit and I found this which looks very similar:
dotnet/yarp#1337
Logs
Environment
Resolution
I've no clue yet.
This is a 🐛 bug-report
Thank you very much if you could look into this!
The text was updated successfully, but these errors were encountered: