Repository navigation
Test turning on analyzer VSTHRD103 in runtime #48540
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8fc6a8f
Turn on VSTHRD103
carlossanlop 07a1c47
Fix actions.
carlossanlop 8a33573
VSTHRD103 suggested fixes in System.IO (CoreLib)
carlossanlop c4444f2
VSTHRD103 suggested fixes in Threading.Tasks (CoreLib)
carlossanlop 7951edb
VSTHRD103 suggested fixes in System.IO (Libraries)
carlossanlop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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.
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.
I don't understand what these comments are trying to say.
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.
Ah, I may have figured it out: What the suggested change is that would make the analyzer happier.
So I guess then my comment is "why are they comments instead of code changes?"
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.
The analyzer warning is noise in most if not all of its comments. We should not be making these changes (or at least none of the ones I've audited thus far).
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.
@bartonjs you figured it out, yes.
My intention with this PR is to show what suggestions this analyzer would give us in runtime, and depending on how noisy it is (meaning how many would be false positives), decide what severity to approve for the API Proposal.
Which brings me back to the question:
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.
Are they all were false positive? No any valid warnings? Is there any case we could tweak the analyzer to not warn for false positives?
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.
We don't need to go through API review.
We should disable it.
It should not be a warning. The noise we have with this in runtime is due to some common patterns that others use as well, e.g. a single method that has paths for sync and async, use of APIs that have an async alternative but where the developer knows the sync path is sufficient (e.g. FileStream.Dispose for a read-only FileStream), use of Task synchronous waiting methods on tasks known to already be complete, etc.
It's possible there's a handful, but I doubt more than one or two that are legit, if that.
It's possible, but it would need to be imbued with much more smarts.
We should definitely consider splitting functionality into multiple pieces. For example, I don't believe the warnings that fire for Task.Result/Wait/etc. should be part of this same diagnostic ID.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks, @stephentoub !
@terrajobst can you please do the honors and mark the proposal as
api-approved? (If there are no more concerns, of course).So I'll just close this PR. No changes for runtime.
I assume this means using the "Info" severity for the rest of the world. Is this correct?
No problem, I can start working on that when moving it to roslyn-analyzers.