fix: dedicated http client for governance telemetry dispatcher#1827
Open
radu-mocanu wants to merge 1 commit into
Open
fix: dedicated http client for governance telemetry dispatcher#1827radu-mocanu wants to merge 1 commit into
radu-mocanu wants to merge 1 commit into
Conversation
radu-mocanu
force-pushed
the
fix/governance-dispatcher-loop-affinity
branch
from
July 22, 2026 15:29
42ba749 to
ee528fc
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes governance telemetry dispatch in the uipath CLI by preventing cross-event-loop reuse of an httpx.AsyncClient and by bounding best-effort telemetry so it can’t hang CLI shutdown.
Changes:
- Create a dedicated
UiPathPlatformGovernanceProvider(fresh async client) for the background-loopLiveTrackEventDispatcher, separate from the policy-fetch provider bound to the main loop. - Add operational safety to telemetry dispatch: per-call total deadline, bounded loop-start wait, shorter default shutdown drain, and warn-once logging for swallowed dispatch failures.
- Add/adjust regression tests for provider separation, warn-once logging, per-call deadline behavior, loop-start timeout behavior, and default shutdown timeout; bump package versions.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/uipath/src/uipath/_cli/_governance_bootstrap.py | Builds a dedicated governance provider for telemetry dispatch to avoid async-client loop affinity issues. |
| packages/uipath/tests/cli/test_governance_bootstrap.py | Updates provider stubbing and adds a regression test ensuring dispatcher uses a distinct provider from policy fetch. |
| packages/uipath-platform/src/uipath/platform/governance/_live_track_event_dispatcher.py | Adds per-call deadline, bounded loop startup wait, warn-once logging for swallowed failures, and shorter shutdown default timeout. |
| packages/uipath-platform/tests/services/test_live_track_event_dispatcher.py | Extends coverage for warn-once logging, per-call deadline cancellation/release, loop-start timeout behavior, and default shutdown timeout. |
| packages/uipath/pyproject.toml | Bumps uipath version to 2.13.14. |
| packages/uipath/uv.lock | Updates lockfile package versions (uipath 2.13.14, uipath-platform 0.2.13). |
| packages/uipath-platform/pyproject.toml | Bumps uipath-platform version to 0.2.13. |
| packages/uipath-platform/uv.lock | Updates lockfile package version to 0.2.13. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
radu-mocanu
force-pushed
the
fix/governance-dispatcher-loop-affinity
branch
from
July 22, 2026 15:37
ee528fc to
e4f7cd2
Compare
|
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.



Summary
uipath run/uipath debug: the track-event dispatcher now uses its own http client instead of the one the policy fetch already bound to the CLI's main event loopWhy
Governance telemetry reused the same httpx
AsyncClientthat the governance policy fetch had already bound to the CLI's main asyncio loop (UiPath.governanceis a cached service), but the dispatcher awaits it on its own background loop. httpx clients are loop-affine, so every event either failed silently or hung, and the stuck calls then dragged out process shutdown. The dispatcher now gets a dedicated service (a fresh client only its loop ever touches), built from the same validated config so it does no extra auth work. Compensation stays on the shared provider because that path is synchronous and has no loop affinity. On top of that, each dispatched call is bounded by a per-call deadline, the exit drain is shortened, the loop-start wait is bounded (fail open), and swallowed failures are surfaced once.