-
Notifications
You must be signed in to change notification settings - Fork 2.2k
cosmos: Enable endToEndTimeout for queryDocumentChangeFeed operation #48144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1439,6 +1439,9 @@ private static void applyExceptionToMergedDiagnosticsForQuery( | |
| exception, | ||
| mostRecentlyCreatedDiagnostics); | ||
| } else { | ||
| if (requestOptions == null) { | ||
| return; | ||
| } | ||
| List<CosmosDiagnostics> cancelledRequestDiagnostics = | ||
| qryOptAccessor | ||
| .getCancelledRequestDiagnosticsTracker(requestOptions); | ||
|
|
@@ -1492,7 +1495,9 @@ private static <T> Flux<FeedResponse<T>> getFeedResponseFluxWithTimeout( | |
| CosmosException cancellationException = getNegativeTimeoutException(null, endToEndTimeout); | ||
| cancellationException.setStackTrace(throwable.getStackTrace()); | ||
|
|
||
| isQueryCancelledOnTimeout.set(true); | ||
| if (isQueryCancelledOnTimeout != null) { | ||
| isQueryCancelledOnTimeout.set(true); | ||
| } | ||
|
|
||
| applyExceptionToMergedDiagnosticsForQuery( | ||
| requestOptions, cancellationException, diagnosticsClientContext); | ||
|
|
@@ -1510,7 +1515,9 @@ private static <T> Flux<FeedResponse<T>> getFeedResponseFluxWithTimeout( | |
| CosmosException exception = new OperationCancelledException(); | ||
| exception.setStackTrace(throwable.getStackTrace()); | ||
|
|
||
| isQueryCancelledOnTimeout.set(true); | ||
| if (isQueryCancelledOnTimeout != null) { | ||
| isQueryCancelledOnTimeout.set(true); | ||
| } | ||
|
|
||
| applyExceptionToMergedDiagnosticsForQuery(requestOptions, exception, diagnosticsClientContext); | ||
|
|
||
|
|
@@ -4775,7 +4782,30 @@ public <T> Flux<FeedResponse<T>> queryDocumentChangeFeed( | |
| diagnosticsClientContext, | ||
| crossRegionAvailabilityContextForRequest); | ||
|
|
||
| return changeFeedQueryImpl.executeAsync(); | ||
| CosmosChangeFeedRequestOptionsImpl implOptions = | ||
| ImplementationBridgeHelpers | ||
| .CosmosChangeFeedRequestOptionsHelper | ||
| .getCosmosChangeFeedRequestOptionsAccessor() | ||
| .getImpl(requestOptions); | ||
|
|
||
| CosmosEndToEndOperationLatencyPolicyConfig endToEndPolicyConfig = | ||
| this.getEffectiveEndToEndOperationLatencyPolicyConfig( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Recommendation — Behavioral Change: PPAF/client-level e2e timeout now applies to Change Feed Processor With
Previously, Why this matters: The Change Feed Processor (CFP) creates its own Suggested action: Consider whether CFP should explicitly set a disabled/null e2e config on its change feed options, or document this behavioral change so users can adjust their client-level config accordingly. |
||
| implOptions.getCosmosEndToEndLatencyPolicyConfig(), | ||
| ResourceType.Document, | ||
| OperationType.ReadFeed); | ||
|
|
||
| Flux<FeedResponse<T>> feedResponseFlux = changeFeedQueryImpl.executeAsync(); | ||
|
|
||
| if (endToEndPolicyConfig != null && endToEndPolicyConfig.isEnabled()) { | ||
| return getFeedResponseFluxWithTimeout( | ||
| feedResponseFlux, | ||
| endToEndPolicyConfig, | ||
| null, | ||
| null, | ||
| diagnosticsClientContext); | ||
| } | ||
|
|
||
| return feedResponseFlux; | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.