-
Notifications
You must be signed in to change notification settings - Fork 5.3k
ServiceProviderEngineScope should aggregate exceptions in Dispose rather than throwing on the first #123342
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
Open
rosebyte
wants to merge
29
commits into
dotnet:main
Choose a base branch
from
rosebyte:features/86426-di-aggregated-exceptions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+159
−16
Open
ServiceProviderEngineScope should aggregate exceptions in Dispose rather than throwing on the first #123342
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
862df69
add try/catch blocks to disposing loops
99cdcf3
remove unused using
54c55a4
Merge branch 'main' into features/86426-di-aggregated-exceptions
rosebyte 244edbe
Bring throw helpers to PUSH_COOP_PINVOKE_FRAME plan (#123015)
am11 94e3e25
Fix assertions generated by optCreateJumpTableImpliedAssertions (#123…
EgorBo d6a6535
[main] Source code updates from dotnet/dotnet (#123247)
dotnet-maestro[bot] 0c3e4c2
Update NativeAOT Docker samples to use .NET 10 images (#123241)
Copilot 15af27b
Add multiple environment variable sets to aspnet2 SPMI collection (#1…
Copilot 01b4433
Fix interpreter threadabort in finally (#123231)
janvorli 7797f55
[RyuJit/WASM] Some fixes related to local addresses and stores (#123261)
SingleAccretion 95f82dd
[Startup] Bump PerfMap ahead of DiagnosticServer (#123226)
mdh1418 0bb8d77
Fix missing static libraries in NativeAOT packs for Apple mobile plat…
Copilot ac1c4e1
[LoongArch64] Fix the failed for Fp32x2StructFunc in the profiler tes…
LuckyXu-HF ec0c992
Cleanup __builtin_available where platform is now guaranteed on Apple…
vcsjones b142b07
Adding C#, F#, VB to StringSyntaxAttribute (#123211)
HakamFostok 08553fc
[RyuJit/WASM] Establish SP & FP and home register arguments (#123270)
SingleAccretion 169cea3
Remove nonExpansive parameter from Dictionary::PopulateEntry (#122758)
Copilot e56355d
Add early return in TryGetLast for empty results. (#123306)
prozolic 5ea3028
[NativeAOT] Source to native mapping fix for out-of-order code (#123333)
rcj1 b1ab9b3
Simplify branching in ILImporter.Scanner.cs with Debug.Assert (#123235)
Copilot a2e63e7
SunOS process and thread support (#105403)
gwr 1d202d4
fix analyzer warnings
c64cd8f
fix analyzer warnings
e658b0e
Merge branch 'main' into features/86426-di-aggregated-exceptions
rosebyte 4308779
implement PR comments
02767e1
Merge branch 'features/86426-di-aggregated-exceptions' of https://git…
dfea777
Merge branch 'main' into features/86426-di-aggregated-exceptions
rosebyte c92eac0
implement PR comments
7a0c529
Merge branch 'features/86426-di-aggregated-exceptions' of https://git…
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
Oops, something went wrong.
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.
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.
Do I understand correctly that before, if any of the services happened to be IAsyncDisposable-only, it literally was breaking all the further disposals? 😅
Should we add a test for this, and also for the mix of IDisposable-only and IAsyncDisposable, to verify it works?
Also, I found that we actually state in the docs regarding IAsyncDisposables in DI:
The way I'd interpret it, we promise here to clean up IAsyncDisposables regardless, but the implementation doesn't follow on this promise? 🤔
There is no warnings about this exception in the
AsyncServiceScope.Dispose()API docs either... Is it documented somewhere?..It might be smth out of scope of this PR, but it feels like something we might potentially want to fix? Especially given we already handle this case above in the
CaptureDisposablemethod.Re: "
catchoutside offor" optimization -- I'd vote for keeping it simple, i.e. ordinaryfor/foreach, andcatchinside it, unless are we actually sure this will give any kind of perf gain (i.e. a microbenchmark). Am I missing smth? I don't think I've seen this pattern in the libraries, e.g. here is a straightforward foreach:runtime/src/libraries/System.Threading.RateLimiting/src/System/Threading/RateLimiting/DefaultPartitionedRateLimiter.cs
Lines 128 to 139 in 531dd27
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.
That`s a good point, how about making an issue specifically about this so we collect more information and fix it in another PR?
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`ve created an issue to further discuss the behaviour, #123620.