-
Notifications
You must be signed in to change notification settings - Fork 494
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
[Preview] Change Feed Processor: Adds notification APIs #2613
Conversation
Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/DocDBErrors/DocDbError.cs
Show resolved
Hide resolved
...soft.Azure.Cosmos/src/ChangeFeedProcessor/Monitoring/ChangeFeedProcessorHealthMonitorCore.cs
Outdated
Show resolved
Hide resolved
From API perspective, one more alternative is to have a single unified notification API and the context will be used to dis-ambiguate/reason on causes. The API surface, discoverability are simple, @ealsur thoughts? |
@kirankumarkolli Could you expand a bit on this? There are 3 events we want to expose:
How do we unify those 3 into a single API? The context for each seem a bit different? #2501 (comment) contains 2 alternatives, either a delegate approach (one delegate per event type and users only hook to what they want, normally just errors), or an abstract class that exposes the events as overridable methods. What other alternatives do you believe could be? |
...soft.Azure.Cosmos/src/ChangeFeedProcessor/Monitoring/ChangeFeedProcessorHealthMonitorCore.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Exceptions/ChangeFeedProcessorUserException.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (except for the error handling comment around custom delegates) - will be very helpful - would be nice to have in Java in similar way as well.
The delegates are scattered contracts of each of such aggregated contract. |
aa6662f
Pull Request Template
Description
This PR enables hooking to events that are happening inside the Change Feed Processor and cover scenarios where there might be internal errors processing the feed or unhandled user errors on the delegate.
It also exposes an exception type to reflect user-related processing errors:
This way, users can optionally subscribe and be notified on unhandled errors happening inside their delegate code or errors that might be happening during the internal Change Feed consumption.
Some errors are recoverable by the Change Feed Processor (see https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed-processor#error-handling), like timeouts, or transient processing errors (an error that occurred within the delegate that might be transient) and the Processor will retry the batch of changes again.
Lease acquire and release reflect events associated with the Change Feed Processor life cycle https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed-processor#processing-life-cycle that some users might be able to leverage in certain scenarios.
Notes on the changes
The code already contained an archaic version of the monitor based on CFP V2 files, part of this PR includes the removal of those unused files and repurposing of others, and making sure that Diagnostics are correctly wired in cases where there are CosmosExceptions tied to the consumption of the change feed.
Type of change
Closing issues
Closes #2501
Closes #1780