fix(search): one indexer timeout no longer discards every other indexer's results#757
Open
t3chnaztea wants to merge 1 commit into
Open
fix(search): one indexer timeout no longer discards every other indexer's results#757t3chnaztea wants to merge 1 commit into
t3chnaztea wants to merge 1 commit into
Conversation
…er's results An HttpClient timeout surfaces as TaskCanceledException, a subclass of OperationCanceledException. The per-indexer catch in the parallel search loop excluded OperationCanceledException, so a single slow/timing-out indexer's exception escaped the catch, propagated out of Task.WhenAll, and discarded every healthy indexer's results for the whole search (zeroing the automatic cycle for the book). No workflow-level cancellation token flows into SearchIndexersAsync, so any OCE there is a per-request timeout: catch it per-indexer, log a warning naming the indexer, and return an empty result for that indexer only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
The bug
The per-indexer catch in
IndexerSearchWorkflow.SearchIndexersAsyncexcludedOperationCanceledExceptionfrom its filter. AnHttpClientper-request timeout throwsTaskCanceledException— a subclass ofOperationCanceledException— so a single slow or timing-out indexer escaped the per-indexer handling, propagated out ofTask.WhenAll, and discarded every healthy indexer's results for the whole search. On the automatic path that zeroes out the entire cycle for that book until the next sweep.The fix
Catch
OperationCanceledExceptionper-indexer, log a warning naming the indexer, and return an empty list for that indexer only — matching how other per-indexer failures already behave. No workflow-levelCancellationTokenflows into this search (verified across the call chain, incl.IIndexerSearchProvider.SearchAsync), so an OCE here can only be a client timeout; there is no shutdown cancellation to preserve.OutOfMemoryException/StackOverflowExceptionremain excluded.Tests
SearchIndexersAsync_OneIndexerTimesOut_ReturnsHealthyIndexerResultsSearchIndexersAsync_AllIndexersTimeOut_ReturnsEmptyWithoutThrowingFull suite green: 1191 passed / 0 failed;
dotnet format --verify-no-changesclean.🤖 Generated with Claude Code