feat(file-processors): add async/fallback support to docling-serve#6014
Draft
sahana-sreeram wants to merge 2 commits into
Draft
feat(file-processors): add async/fallback support to docling-serve#6014sahana-sreeram wants to merge 2 commits into
sahana-sreeram wants to merge 2 commits into
Conversation
Docling team confirmed async endpoints work on both local and SaaS. Default to async mode with automatic fallback to sync on failure. This eliminates timeout issues under load and enables compatibility with IBM Docling SaaS async-only endpoints. - Added async submit/poll/result workflow methods - Implemented automatic fallback from async to sync - Added unit tests for async mode and fallback behavior Will need rebase after ogx-ai#5627 merges. Signed-off-by: Sahana Sreeram <sahanasreeram01@gmail.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.
What does this PR do?
Adds async API support to the
remote::docling-servefile processor with automatic fallback to sync endpoints.Problem: The sync API (
/v1/convert/file) blocks for the entire processing duration, so larger PDFs under concurrent loadcan exceed HTTP timeouts. The sync workflow is also incompatible with IBM
Docling SaaS, which only exposes async endpoints.
Solution: Implement the async submit/poll/result pattern (
/v1/convert/file/async → GET /status/poll/{task_id} → GET /result/{task_id}) with automatic fallback to sync if async fails. The docling team confirmed async endpoints areavailable on local docling-serve and SaaS.
mode="async"(default): use async endpoints, fall back to sync on failuremode="sync": use sync endpoints only (manual fallback)mode="auto": detect server capabilities and chooseThe async workflow eliminates timeout issues and enables SaaS compatibility. Fallback
ensures resilience when async endpoints are unavailable.
Will need to rebase after #5627 (async request scheduler) merges.
Test Plan
Validated async functionality using both unit tests and integration testing against a local Docling Serve instance.
Unit Tests
All existing tests pass plus 4 new tests covering async behavior: