AdaptiveCapacityDictionary assert with 11 elements #34307
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
bug
This issue describes a behavior which is not expected - a bug.
Milestone
The client sent 11 cookies, the threshold for ACD is 10.
While this is only an assert, I expect being in this invalid state will cause some weird side-effects, potentially discarding cookies when doing incorrect resizes.
Stack walk:
_dictionaryStorage and _arrayStorage are not both supposed to have a value
aspnetcore/src/Shared/Dictionary/AdaptiveCapacityDictionary.cs
Lines 579 to 583 in 12c57a5
Indexer.Set:
aspnetcore/src/Shared/Dictionary/AdaptiveCapacityDictionary.cs
Line 141 in 12c57a5
aspnetcore/src/Http/Shared/CookieHeaderParserShared.cs
Line 37 in 12c57a5
Collection created:
aspnetcore/src/Http/Http/src/Internal/RequestCookieCollection.cs
Lines 73 to 76 in 12c57a5
(related: using StringValues.Count as the initial capacity is actually a bad idea, cookies are supposed to be sent in a single header so there should only be 0 or 1 entries in the StringValues. (except for a Kestrel HTTP/2 #26461 bug which I think is necessary to hit this issue).
Bug: The capacity constructor initializes both fields.
aspnetcore/src/Shared/Dictionary/AdaptiveCapacityDictionary.cs
Lines 79 to 80 in 12c57a5
The text was updated successfully, but these errors were encountered: