Don't cache Endpoints if a source throws #43729
Merged
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.
Description
Don't cache Endpoints in CompositeEndpointDataSource if a child EndpointDataSource source throws. CompositeEndpointDataSource is almost always the root EndpointDataSource, so this affects most apps.
Fixes #43693
Customer Impact
Without this fix, you do not see endpoint generation errors after the first request. You should see something like:
But instead get 404s after the first failed request:
We should be consistently throwing exceptions to outer middleware like the one responsible for the developer exception page and producing 500s instead of 404s.
Regression?
This is a regression introduced in 7.0-preview6 by #42195.
Risk
This is merely waiting to cache a list later after we know nothing threw while generating the list's elements.
Verification
Packaging changes reviewed?
@Pilchie