You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add outbound request timeout support
Add a JsonRpc-wide OutboundRequestTimeout that applies to response-expected outbound calls, turns timeout-origin failures into TimeoutException, preserves caller cancellation tokens, and exercises the behavior across direct, proxy, and cancellation-strategy tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR feedback on outbound timeouts
Translate timeout-driven send-path cancellations into TimeoutException, align most timeout tests with ExpectedTimeout, and keep the custom cancellation-strategy timeout at 100ms because the larger shared timeout hangs on net472 in that scenario.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Stabilize outbound-timeout tests on Windows CI
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR timeout race and atomicity feedback
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
/// Backing field for the <see cref="OutboundRequestTimeout"/> property.
131
+
/// Stores timeout ticks, with 0 representing <see langword="null"/>.
132
+
/// </summary>
133
+
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
134
+
privatelongoutboundRequestTimeoutTicks;
135
+
129
136
/// <summary>
130
137
/// Backing field for the <see cref="SynchronizationContext"/> property.
131
138
/// </summary>
@@ -590,6 +597,47 @@ public bool CancelLocallyInvokedMethodsWhenConnectionIsClosed
590
597
}
591
598
}
592
599
600
+
/// <summary>
601
+
/// Gets or sets the timeout to apply to each outbound invocation that expects a response.
602
+
/// </summary>
603
+
/// <value>
604
+
/// The timeout, or <see langword="null"/> to disable this behavior.
605
+
/// The default value is <see langword="null"/>.
606
+
/// </value>
607
+
/// <remarks>
608
+
/// <para>
609
+
/// This timeout is applied to outbound method invocations (such as <see cref="InvokeWithCancellationAsync(string, IReadOnlyList{object?}?, CancellationToken)"/> and proxy method calls),
610
+
/// but not notifications.
611
+
/// </para>
612
+
/// <para>
613
+
/// When a timeout triggers, a notification is sent to the server to request cancellation
614
+
/// and the local invocation is immediately canceled allowing the caller to handle the timeout
615
+
/// as a <see cref="TimeoutException"/>.
616
+
/// </para>
617
+
/// </remarks>
618
+
/// <exception cref="ArgumentOutOfRangeException">Thrown if a non-positive timeout value is assigned.</exception>
<value>The outbound JSON-RPC invocation was canceled automatically after reaching the timeout configured by {0}. The server may still be processing the request.</value>
0 commit comments