fix race condition between ProgressRecord being updated while rendering#2771
fix race condition between ProgressRecord being updated while rendering#2771SteveL-MSFT wants to merge 5 commits intoPowerShell:masterfrom SteveL-MSFT:2756-pendingprogress-exception
Conversation
|
running tests under codecoverage is blocked by this, with this change, codecoverage run completed |
| private ArrayList _topLevelNodes = new ArrayList(); | ||
| private int _nodeCount; | ||
| private const int maxNodeCount = 128; | ||
| private static object _pendingProgressLock = new object(); |
There was a problem hiding this comment.
Why static? All affected methods are instance methods.
|
Actually, if Also the comment at the top of the file suggests that class code could be simplified, but it's out of scope of this PR |
|
@vors made change to ReaderWriterLockSlim, verifying change |
|
By reading the code, it looks to me that Second, this lock protects accessing to the type field Maybe we should just have a lock in |
|
If we are manipulating data structures as part of showing progress, maybe a timer was the wrong approach - it seems possible that we might make a mess of things somehow by not rendering everything that was asked of us. On the other hand, maybe the progress rendering handles such cases already on the assumption that the user did a poor job, e.g. not reporting the completion of some child event. |
|
It turns out the current timer approach could result in more potential race conditions, for example, the timer might be disposed on the main pipeline thread while it's being called on the timer thread, the I will close this PR and submit another one to revert the timer change. |
|
The new PR is #2806. |
addresses #2756