Skip to content

Fix AdaptiveCapacityDictionary assert with 11 elements #34313

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

Merged
merged 3 commits into from
Jul 14, 2021

Conversation

Tratcher
Copy link
Member

Fixes #34307

AdaptiveCapacityDictionary starts with an Array and then transitions to a Dictionary after 10 elements. It uses null checks on these fields to figure out which mode it's in. However, one constructor was initializing both fields and put the object in an invalid state.

This is a Debug.Assert failure that Hao noticed when manually testing something. It's a 6.0 regression introduced with the new AdaptiveCapacityDictionary. Neither of us saw any incorrect product behavior related to the bug, but there's potential for it given the invalid state the object is in.

Related: the cookie parser shouldn't be assuming that the StringValues.Count is the cookie count. The Cookie header is supposed to be a single value so StringValues.Count would normally be 0 or 1. There is a Kestrel Http/2 bug (#26461) where you can get more values, which is how Hao ran into this issue.

@Tratcher Tratcher added this to the 6.0-preview7 milestone Jul 13, 2021
@Tratcher Tratcher requested a review from HaoK July 13, 2021 19:23
@Tratcher Tratcher self-assigned this Jul 13, 2021
@davidfowl
Copy link
Member

Nice find!

@Tratcher Tratcher enabled auto-merge (squash) July 13, 2021 21:34
@Tratcher
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Tratcher Tratcher merged commit 1395fa8 into dotnet:main Jul 14, 2021
@Tratcher Tratcher deleted the tratcher/cookies branch July 14, 2021 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AdaptiveCapacityDictionary assert with 11 elements
4 participants