Skip to content

fix(cloud): retry transient outline polling failures - #712

Open
DivyamTalwar wants to merge 1 commit into
VectifyAI:mainfrom
DivyamTalwar:fix/retry-outline-polls
Open

DivyamTalwar wants to merge 1 commit into
VectifyAI:mainfrom
DivyamTalwar:fix/retry-outline-polls

Conversation

@DivyamTalwar

Copy link
Copy Markdown

Problem

build_outline(wait=True) can abort after the server has accepted the build. If the outline status GET fails even after the HTTP adapter retries it, the SDK exits the wait immediately. The outline job continues in the cloud. The same wait path is used when an upload requests an outline explicitly.

Changes

  • Continue polling after transient status-read failures, using the same HTTP status codes as the cloud adapter. Stop after three consecutive failed reads or when the polling timeout is reached.
  • Preserve terminal errors and the final error when retries are exhausted. The polling recovery only retries the status GET and never repeats an accepted kickoff POST.
  • Cap the delay between polls at the remaining time. The HTTP adapter still owns its per-request timeout.

Validation

  • With the real Requests adapter and a loopback HTTP server, main raised HTTP 502 after one POST and three GETs. The branch completed after one POST and four GETs. The server returned 502 for the first three GETs and success for the fourth.
  • python -m pytest tests/test_client.py -q -k 'wait_document or wait_extract or wait_classif or upload or build_outline or get_outline' --tb=short passed 27 tests.
  • Regressions exercise a recovering build, a recovering upload, terminal HTTP 403, repeated HTTP 502, and the retry deadline.

AI-assisted implementation and testing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant