Skip to content

Conversation

@akarnokd
Copy link
Collaborator

@akarnokd akarnokd commented Apr 8, 2019

When the clock change is notified, any modification to the SystemClockChanged hashset from the callbacks results in an InvalidOperationException. The fix is to create a copy of the hashset contents and enumerate that.

Resolves #879

@clairernovotny
Copy link
Contributor

Is there any tests we can add to verify this behavior?

@akarnokd
Copy link
Collaborator Author

akarnokd commented Apr 8, 2019

Looks complicated to do it: get in a scheduler that unregisters itself upon a time change signal and also trigger a time change event. Maybe if we expose the relevant private fields or methods (such as OnSystemClockChanged()).

@clairernovotny
Copy link
Contributor

We can make things internal if needed, then I think the InternalsVisibleTo should let the tests call it. Another approach could be a new internal-only method that sets the values as desired just for testing?

@clairernovotny clairernovotny merged commit 962a3f7 into dotnet:rel/v4.1 Apr 8, 2019
@akarnokd akarnokd deleted the SystemClockChangeCrashFix branch April 8, 2019 16:39
liorm added a commit to Xperitos/Xperitos.Common that referenced this pull request Sep 10, 2019
It happens all the time when debugging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants