fix(content-drive): fail request instead of silently returning partial results on ES sub-query failure (#37488) - #37489
Conversation
…l results on ES sub-query failure
❌ Linked Issue Needs Team LabelThis PR is linked to issue #37488, but that issue has no How to fix this:Apply a This comment was automatically generated by the issue linking workflow |
|
Claude finished @ihoffmann-dot's task in 1m 35s —— View job Code Review
The change is correct and does what it claims. The Concurrency semantics check out: since New Issues
Notes (non-blocking, not introduced by this PR)
The behavior change itself is intentional per #37488: transient ES hiccups on a browse/Content Drive request will now surface as an error rather than a silently short page. That's the stated goal. The unchecked integration-test box in the PR body is the real gap — a test forcing a sub-query failure and asserting the request surfaces an error would lock in this behavior. Understandable that it needs ES/DB-level mocking beyond the current unit scaffolding, but worth a follow-up. |
Summary
processSingleESQuery/processMultipleESQueriesinBrowserAPIImplused to swallow ES sub-query exceptions/timeouts and quietly return an empty result, so a failed or slow sub-query silently dropped its share of matches and the caller got HTTP 200 with a short/incomplete page.DotDataException/DotRuntimeException, so the request surfaces a visible error instead of a silently incomplete page.Fixes #37488. Follow-up from #37395 (single-pass field filter resolution) review — flagged as pre-existing behavior made more likely to matter once that PR widens the ES fan-out per request.
Caller audit
Traced every caller of
processSingleESQuery/processMultipleESQueries: the only path isprocessESDirectly→getChunkFiltered→getContentByChunks→doHybridSingleChunkedQueryES→doElasticSearchTextFiltering→getContentUnderParentFromDB, which already declares/wrapsDotDataExceptionand rethrows asDotRuntimeException. No caller depended on the old empty-result-on-failure fallback.Test plan
./mvnw compile -pl :dotcms-core— clean🤖 Generated with Claude Code