This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Fix 3.0->3.1 regression in JSON serializing nested concurrent dictionaries#42772
Merged
Anipik merged 3 commits intodotnet:release/3.1from Jan 14, 2020
Merged
Fix 3.0->3.1 regression in JSON serializing nested concurrent dictionaries#42772Anipik merged 3 commits intodotnet:release/3.1from
Anipik merged 3 commits intodotnet:release/3.1from
Conversation
ericstj
reviewed
Dec 13, 2019
Member
|
Can you link to the change you’re back porting |
Contributor
Author
|
dotnet/runtime#784 fixes dotnet/runtime#670 for runtime/master (5.0), but doesn't contain the change on deserialization described above. We can consider this PR a back-port + the deserialization change. |
ericstj
approved these changes
Dec 16, 2019
Member
ericstj
left a comment
There was a problem hiding this comment.
LGTM: @ahsonkhan or @steveharter can you also review?
Note that this cannot merge until it is approved for servicing. Please add the servicing template to the pull request description.
Member
|
@ericstj is this ready for tactics consideration now? just noticed it's not tagged but I see the template above |
Member
|
Yeah this is good, @steveharter signed off on same code change in master. |
Member
|
Approved for March. |
Member
|
Moved back to 3.1.2 per tactics. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes dotnet/runtime#670, where there was a regression between 3.0 and 3.1 where serializing nested concurrent dictionaries went from supported to unsupported. The issue also exists in master/5.0. dotnet/runtime#784 fixes it in master, and this PR ports the fix to 3.0.
In addition to the fix described above, this PR also also has a deserialization fix for an
InvalidCastExceptionthrown when a dictionary element type has a converter that returns a type different from the declared type, e.g. when you're deserializingDictionary<string, MyClass>, whereIn this case, the read method of the converter for
typeof(MyClass)returns a typeIClass(not the declared type,MyClass) which causes anInvalidCastExceptionlater in the deserialization flow.Customer Impact
The ability to serialize nested concurrent dictionaries is restored: dotnet/runtime#670.
The deserialization scenario is an edge case, but the fix defends against leaking exceptions were it to occur.
Regression
No. The serialization change's tests are wide-ranging and covers various permutations of nested dictionaries, so a regression is unlikely.
The deserialization change adds more support without rescinding support. A regression is unlikely.
Risk
Low, per the regression section above.