Repository navigation
Bound docling-serve load from public readiness checks - #11
Merged
Merged
Conversation
/health/ready is public and probed the remote docling-serve (with the bearer token and connect retries) on every request, so caller volume translated directly into load on docling-serve. Share one in-flight or recent probe per (URL, token) for 30 seconds; concurrent and repeated readiness requests reuse it, including failures. The readiness contract is unchanged: docling-serve reachability still gates "ready", which the post-deploy curl relies on for slim images. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
szweibel
added a commit
that referenced
this pull request
Oct 4, 2026
Brings in PR #11 (bound docling-serve load from public readiness checks). The only conflict was test_readiness.py's imports: the branch builds real Settings instead of SimpleNamespace, and main added asyncio for its concurrency test. Co-Authored-By: Claude Opus 5.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.
Problem
/health/readyis exempt from identity (_PUBLIC_IDENTITY_PATHS) and is exposed publicly attools.ailab.gc.cuny.edu/pdf-accessibility/health/ready. On every call,_docling_checkopened a new client and sent a bearer-authenticatedGET {DOCLING_SERVE_URL}/healthwith up to 3 connect attempts. The number of outbound requests to docling-serve on the Tailscale host scaled directly with anonymous request volume.Change
_probe_docling_serve._cached_docling_serve_probeshares a single probe task per(URL, token)for 30 seconds. Concurrent callers await the same in-flight task, and later callers in the window reuse its result. Failures are cached too, so an unreachable docling-serve isn't hit repeatedly.asyncio.shieldstops one client disconnect from cancelling the shared probe.Why not move the probe off public readiness
/health/readyhas one consumer: the post-deploycurl -fsSin the README, run against both local and public URLs. The DockerHEALTHCHECKand CI smoke test use/health.The response shape, the 200/503 semantics and the
checks.docling.metadata.health_checkvalues are unchanged.Tests
test_concurrent_readiness_requests_share_one_remote_docling_probe: 25 concurrent calls plus one sequential call result in 1 outbound request.test_remote_docling_probe_failure_is_cached_until_window_expires: a failure is reused until the window ends, then re-probed (clock is monkeypatched)../scripts/check.shpasses: 535 backend tests, frontend lint and build.🤖 Generated with Claude Code