Isolate provider search failures instead of failing the whole request - #329
Open
lawrencejames24 wants to merge 1 commit into
Open
Isolate provider search failures instead of failing the whole request#329lawrencejames24 wants to merge 1 commit into
lawrencejames24 wants to merge 1 commit into
Conversation
searchSeriesMetadata launched each provider's search concurrently but then awaited them sequentially without catching per-provider errors, so a single failing provider (e.g. one returning 403) would throw and discard results from every other provider that had already succeeded, surfacing as a 500 to callers even though most providers were fine. Now each provider's result is caught individually and logged on failure, contributing only its own results to the aggregate instead of aborting the whole search. Fixes Snd-R#216
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.
Summary
MetadataService.searchSeriesMetadatalaunched each provider's search concurrently but awaited them without catching per-provider errors, so one failing provider (e.g. a 403 from a scraping-blocked source) would throw and discard results from every other provider that had already succeeded — surfacing as a 500 to callers even though most providers returned fine.Fixes #216 (at least for the manual/plain search path; the job-based auto-match flow has its own separate error handling in the same file that could use a similar treatment if useful).
Test plan
./gradlew :komf-mediaserver:compileKotlinJvmbuilds clean