Skip to content

feat(client): update request timeout policy at runtime - #593

Merged
SunSi12138 merged 5 commits into
devfrom
issue-578-runtime-request-timeout
Sep 7, 2026
Merged

feat(client): update request timeout policy at runtime#593
SunSi12138 merged 5 commits into
devfrom
issue-578-runtime-request-timeout

Conversation

@SunSi12138

@SunSi12138 SunSi12138 commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Closes #578

Scope

Adds runtime request-timeout policy replacement for future logical calls without rebuilding or reconnecting the client.

  • ISharpLinkClient.UpdateRequestTimeout(TimeSpan) atomically publishes an enabled custom fallback.
  • ISharpLinkClient.DisableRequestTimeout() atomically publishes a disabled fallback.
  • GetRequestTimeoutPolicySnapshot() exposes the current immutable generation, source and effective timeout.
  • candidates are validated before publication and updates are rejected once stop/drain/fault lifecycle begins.
  • each logical call captures exactly one timeout-policy generation while resolving call control; the resulting deadline remains frozen across interceptor suspension, retries and streaming lifetime.
  • explicit method-level timeout keeps precedence; parameterless method timeout still falls back to the captured client policy; inherited deadline behavior is unchanged.
  • publication uses the existing client state gate only on mutation; the RPC hot path performs one volatile generation read and adds no new lock.

Regression

SharpLinkClientRuntimeRequestTimeoutTests covers:

  • an in-flight call retaining its original 10s deadline after the client publishes a 1s generation, while a later call observes 1s;
  • enable / invalid-candidate / disable publication and idempotent disable;
  • explicit method timeout precedence and parameterless method fallback;
  • concurrent enable/disable snapshots never exposing torn policy state;
  • update rejection after stop begins.

Branch head: 27d13b6216b35ac2b678d41a4acb80902ee45269.
Target validated by PR merge ref: dev@f643aee53e411fa2a6825cf484787069468f9c64.

Validation

  • PR Fast run 34131406970: PASS — Release build, full Unit/Generator/Load tests, formatting/maintainability and deterministic allocation gate.
  • Ready-state PR Fast run 34132885891 attempt 2: PASS. The first attempt hit two unrelated existing timing flakes outside the changed Client timeout surface; rerun on the identical merge ref passed the full suite.
  • CodeQL run 34131406982: PASS.
  • PR Extended run 34132910880: PASS — Debug/Release builds, full Integration Tests, NativeAOT transport/topology smoke, package verification/smoke, demo/load smoke, and desktop cross-platform codec compatibility matrix.

@SunSi12138
SunSi12138 marked this pull request as ready for review September 7, 2026 14:25
@SunSi12138
SunSi12138 merged commit d03ef7e into dev Sep 7, 2026
28 of 29 checks passed
@SunSi12138
SunSi12138 deleted the issue-578-runtime-request-timeout branch September 7, 2026 15:38
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