-
Notifications
You must be signed in to change notification settings - Fork 7.7k
fix race condition between ProgressRecord being updated while rendering #2771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix race condition between ProgressRecord being updated while rendering #2771
Conversation
running tests under codecoverage is blocked by this, with this change, codecoverage run completed |
@@ -1207,8 +1216,6 @@ internal static | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why static
? All affected methods are instance methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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