Skip to content

Comments

Fix failing debug assertion in JsonTypeInfo initialization#67334

Merged
eiriktsarpalis merged 1 commit intodotnet:mainfrom
eiriktsarpalis:fix-failing-jsontypeinfo-assertion
Mar 30, 2022
Merged

Fix failing debug assertion in JsonTypeInfo initialization#67334
eiriktsarpalis merged 1 commit intodotnet:mainfrom
eiriktsarpalis:fix-failing-jsontypeinfo-assertion

Conversation

@eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented Mar 30, 2022

Fixes a failing debug assertion in what seems to be a race when multiple threads attempt to initialize the JsonTypeInfo instance. It is likely that other initialization methods are impacted by the same issue, this PR is to unblock the CI issues as reported in #60962.

The initialization logic should be refactored so that metadata instances get initialized by a single thread, which will likely be done in conjunction with the work for #63686 cc @krwq.

Fix #60962.

@ghost
Copy link

ghost commented Mar 30, 2022

Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes a failing debug assertion in what seems to be a race when multiple threads attempt to initialize the JsonTypeInfo instance. It is likely that other initialization methods are impacted by the same issue, this PR is to unblock the CI issues as reported in #60962.

The initialization logic should be refactored so that metadata instances get initialized by a single thread, which will likely be done in conjunction with the work for #63686 cc @krwq.

Fix #60962.

Author: eiriktsarpalis
Assignees: -
Labels:

area-System.Text.Json

Milestone: -

@eiriktsarpalis eiriktsarpalis requested review from krwq and layomia March 30, 2022 11:41
@eiriktsarpalis eiriktsarpalis added this to the 7.0.0 milestone Mar 30, 2022
@eiriktsarpalis eiriktsarpalis merged commit 203a901 into dotnet:main Mar 30, 2022
@eiriktsarpalis eiriktsarpalis deleted the fix-failing-jsontypeinfo-assertion branch March 30, 2022 15:10
@ghost ghost locked as resolved and limited conversation to collaborators Apr 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failed at double initialization assert in System.Text.Json.Serialization.Metadata.JsonTypeInfo.InitializePropCache()

2 participants