Uh oh!
There was an error while loading. Please reload this page.
Make concurrent reads on HttpHeaders thread-safe - #68115
Conversation
ghost
commented
Apr 16, 2022
Tagging subscribers to this area: @dotnet/ncl Issue DetailsFixes #61798 Adds no overhead if headers are both added & enumerated without validation.
|
MihaZupan
commented
Apr 21, 2022
@dotnet/ncl PTAL The change boils down to adding a
Since a value entry can transition from being a The code also has to be careful when reading the value of a given entry. if(entries[i].ValueisHeaderStoreItemInfo){// ...}else{DoSomething((string)entries[i].Value);// Wrong! The value may now be HeaderStoreItemInfo}and it should instead be something like objectvalue=entries[i].Value;if(valueisHeaderStoreItemInfo){// ...}else{DoSomething((string)value);}I've looked through our current code to make sure this is the case, but it's possible future changes may accidentally break this. I've added a test that should catch most such mistakes, but there may be cases that aren't covered. |
CarnaViire
left a comment
There was a problem hiding this comment.
LGTM, but maybe someone else could also take a look 🙂
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
CarnaViire
commented
Apr 29, 2022
Does this change fully address #61798 ? I see the issue mentioning invalid values too, but this change only adds locks? |
MihaZupan
commented
Apr 29, 2022
juharris
commented
May 9, 2022
Will this change be in an upcoming version 6 update? If so, any idea when? |
MihaZupan
commented
May 9, 2022
It will be in preview 5 of .NET 7. If you mean whether it will be backported to 6.0, there are currently no plans for that. |
Fixes#61798
Lowers the impact of bugs like #66989 and #65379.
Adds no overhead if headers are both added & enumerated without validation.
Simpler to review when hiding whitespace changes.