• M
    Fix race condition when generating simulated compilation events · 1a42019d
    Manish Vasani 提交于
    User scenario: Analysis might get skipped in the IDE for a symbol/partial declarations for a partial symbol with more than one definition in a single document.
    
    Cause: When computing symbols declared in the tree to generate symbol declared events, we were adding duplicate entries if a symbol had more than one partial declaration in a tree. This meant that multiple threads might start performing symbol analysis on the same symbol, causing a race condition as driver doesn't expect duplicate events. Though we ensure not to make duplicate callbacks, we might end up missing on making some callbacks at times.
    
    Fix: Compute only unique symbols from declarations in a tree.
    
    Risk: None, it is a trivial fix.
    
    Testing: Before the fix, I was able to repro the race condition and the assert consistently by running the flaky test in a loop for over 10k times. After the fix, it doesn't repro on running the same multiple times. A new unit test has also been added, though it did not fail consistently even before the fix.
    
    Fixes #9462
    1a42019d
AnalysisState.cs 33.9 KB