TaskFactoryWrapper: guard against multi-threaded access to dictionaries#8928
Conversation
|
The PR checks are showing failures in Are these known failures that should not block completion of this PR? |
Yes, should be fixed by #8927. I'll rerun here to confirm. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 8928 in repo dotnet/msbuild |
|
@rainersigwald / @JanKrivanek - it looks like there might be an infra issue that caused the msbuild-pr (Windows Full) check to fail. I don't have sufficient perms to re-run the checks. Could one of you re-run them? |
|
FYI @rokonec - this is similar situation as we discussed over #8861 - the concurrently accessed structure ( |
|
@rainersigwald, could I get another approval on this PR? Thanks. |
|
@jdrobison we're hoping to solve the problem a different way so we're not ready to accept (or reject) this yet. |
|
@jdrobison appology for the confusion on this ticket - we've been looking deeper into few seemingly unrelated tickets manifesting multithreaded usage of TaskRegistry, that is not expected to be used in multithreaded context - and addressed this by preventing unintended sharing |
|
superseded by #8973 |
|
@JanKrivanek - understood, thanks. |
|
@jdrobison - Can you restore your Upon detailed investigation of our So we want to take your original fix |
|
@JanKrivanek - my branch has been restored, but I'm not sure how to reactivate the PR. Suggestions welcome. |
|
(The button was way down below "comment") |
|
Thanks, @rainersigwald! |
…askFactoryWrapper-dictionaries
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1824802
This change protects the dictionaries owned by
TaskFactoryWrapperfrom being mutated while being accessed by multiple threads.TaskFactoryWrapper's dictionary fields fromIDictionary<K,V>toIReadOnlyDictionary<K,V>IReadOnlyDictionary<K,V>toReadOnlyEmptyDictionaryTaskFactoryWrapper.PopulatePropertyInfoCacheIfNecessary, which is the place where all of the object's dictionaries are created.