Repository navigation
PC-5206: wait out Integration Service, never re-send timed-out activity - #1963
Draft
al3xanndru wants to merge 1 commit into
Draft
al3xanndru wants to merge 1 commit into
al3xanndru wants to merge 1 commit into
Conversation
…ivities ConnectionsService.invoke_activity(_async) used the SDK's default 30 s httpx timeout and BaseService's retry, which re-sends a request on any TimeoutException up to 5 times. Integration Service waits up to ~120 s on the vendor behind an activity, so a slow data source made the client hang up and POST the same non-idempotent activity 5 times while IS ran every copy and answered 200. Activity calls now get a 150 s read timeout (connect/write/pool stay 30 s) and do not retry a ReadTimeout. Connect failures, pool and write timeouts and retryable statuses are still retried as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch has not been deployed
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
PC-5206 (Bug, Minor): an agent's Integration Service tool run fails although Integration Service still answers.
ConnectionsService.invoke_activity/invoke_activity_async(the only caller is the agent IS tool,uipath_langchain/agent/tools/integration_tool.py) use the SDK's default httpx timeout of 30 s (common/_http_config.py). They also useBaseService.request's retry, which re-sends on anyTimeoutException, up toMAX_RETRY_ATTEMPTS = 5(common/retry.py::is_retryable_platform_exception). Integration Service waits up to about 120 s on the vendor behind an activity. When the data source is slow:Evidence (DRI archive, cause
is-tool-30s-client-timeout-retries-post-while-is-working):a1a0c713-a321-4339-af24-1c54ffa62bc8httpx.ReadTimeoutat 30.0 sf49af9f4-…88f2a28d-1d69-430d-9850-72bb14cf7b01Root cause
The client's per-attempt budget (30 s) is shorter than the service's (~120 s). The retry policy also treats a read timeout, where the request was delivered and is still being processed, like a connect failure, where nothing was sent, and re-sends a non-idempotent POST.
Change
packages/uipath-platform/src/uipath/platform/connections/_connections_service.pyonly:timeout=Timeout(30.0, read=150.0). This follows the per-request override pattern already used byPiiDetectionService. The read timeout outlasts IS's ~120 s vendor budget, so the client gets IS's real answer: the 200, or IS's own 4xx/5xx. Connect, write and pool timeouts stay at 30 s.BaseService.request(_async).retry_with(retry=…), which keeps BaseService's wait and stop strategies. The only change is a predicate that returnsFalseforhttpx.ReadTimeoutand defers tois_retryable_platform_exceptionfor everything else. Connect errors,ConnectTimeout,PoolTimeout,WriteTimeoutand the retryable statuses (408/429/502/503/504/524) are retried exactly as before.uipath-platform0.2.41 → 0.2.42 (pyproject and bothuv.lockentries, as the previous platform fixes did).BaseService,common/retry.pyand the global 30 s default are unchanged, so no other service's behaviour changes.Tests
New in
tests/services/test_connections_service.py::TestConnectorActivityInvocation:test_invoke_activity_waits_longer_than_integration_servicetest_invoke_activity_read_timeout_not_retried(sync)test_invoke_activity_async_read_timeout_not_retried(async)test_invoke_activity_async_connect_error_still_retriedConnectTimeoutis still retried, and the second attempt succeeds.test_invoke_activity_retryable_status_still_retriedResults:
pytest tests(uipath-platform): 1747 passed, 11 skipped (credential-bound integration tests).ruff check .,ruff format --check .andmypy src tests(233 files) are clean.The sandbox could not reach PyPI, so these ran on Python 3.12 from an existing venv (ruff 0.15.12), with this checkout's
srcfirst on the path, not withuv sync. CI should re-run them on 3.11.Risks / open questions
retry_withand# type: ignore[attr-defined]. The change relies on tenacity'sretry_withon the decoratedBaseService.request(_async)(tenacity ≥ 9, as pinned). tenacity's stubs type the decorated function as the original callable, hence the two ignores.integration_tool.pystill turns a timeout into a fatal SystemAgentRuntimeErrorthat says "usually a transient issue; please retry". With this change it fires only when IS takes more than 150 s. Rewording it, or returning it to the LLM as a tool error, is for that repo's maintainers.Drafted by the wabbit-dri draft-fixes loop for PC-5206 (draft #1), for a human to review: not ready to merge as is.
🤖 Generated with Claude Code