Ensure file change notification is executed after file change is done#5511
Merged
JanKrivanek merged 4 commits intodotnet:mainfrom Nov 3, 2022
Merged
Ensure file change notification is executed after file change is done#5511JanKrivanek merged 4 commits intodotnet:mainfrom
JanKrivanek merged 4 commits intodotnet:mainfrom
Conversation
JanKrivanek
requested changes
Oct 26, 2022
Member
JanKrivanek
left a comment
There was a problem hiding this comment.
It looks good. Though I think we need to be carefull about possible cumulation of Tasks waiting to acquire the lock
src/Microsoft.TemplateEngine.Edge/BuiltInManagedProvider/GlobalSettings.cs
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Edge/BuiltInManagedProvider/GlobalSettings.cs
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Edge/BuiltInManagedProvider/GlobalSettings.cs
Show resolved
Hide resolved
vlada-shubina
approved these changes
Nov 2, 2022
Member
vlada-shubina
left a comment
There was a problem hiding this comment.
Looks good for the purpose, only localization should be added.
Also consider filing the issue to improve the handling of duplicate events as SettingsChanged will trigger long-running rescan.
src/Microsoft.TemplateEngine.Edge/BuiltInManagedProvider/GlobalSettings.cs
Show resolved
Hide resolved
src/Microsoft.TemplateEngine.Edge/BuiltInManagedProvider/GlobalSettings.cs
Show resolved
Hide resolved
JanKrivanek
approved these changes
Nov 3, 2022
Member
|
/port to release/7.0.2xx |
Member
|
/backport to release/7.0.2xx |
Contributor
|
Started backporting to release/7.0.2xx: https://github.com/dotnet/templating/actions/runs/3387139418 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#5344 - In GlobalSettings file change notification might be announced while the file is still in progress of being changed.
Solution
Ensure file change notification is executed after file change is done. It could resolve the test issue: in
Microsoft.TemplateEngine.Edge.UnitTests.TestFileWatcherwhile settings.json file is still being written, reading the file fails within the retries and then the IOException is thrown out.Checks:
#nullable enableto all the modified files ?