fix(eventhubs): owner_level support and fix partition expiration default#3883
fix(eventhubs): owner_level support and fix partition expiration default#3883hjarraya wants to merge 1 commit intoAzure:mainfrom
Conversation
|
Thank you for your contribution @hjarraya! We will review the pull request and get back to you soon. |
|
@microsoft-github-policy-service agree [company="SAMBAC LAB UK LTD"] @microsoft-github-policy-service agree @microsoft-github-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Pull request overview
Adds receiver epoch (“owner_level”) support to the EventProcessor builder and adjusts the default partition ownership expiration to better align with the rebalance cadence, reducing the chance of widespread duplicate processing.
Changes:
- Plumbs
owner_levelfromEventProcessorBuilderthrough toOpenReceiverOptionswhen opening partition receivers. - Updates
DEFAULT_PARTITION_EXPIRATION_DURATIONfrom 10s to 60s to avoid ownerships expiring before the next update cycle.
sdk/eventhubs/azure_messaging_eventhubs/src/event_processor/processor.rs
Outdated
Show resolved
Hide resolved
sdk/eventhubs/azure_messaging_eventhubs/src/event_processor/processor.rs
Show resolved
Hide resolved
c8bb33c to
3896a95
Compare
|
@hjarraya please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
3896a95 to
8f2fc95
Compare
…d add partition revocation - Pass owner_level to AMQP receiver link as com.microsoft:epoch for broker-enforced exclusive partition access - Fix default partition expiration from 0s to 60s so load balancer properly detects stale ownerships - Add partition revocation mechanism: when dispatch() detects partitions lost to other consumers, it revokes the corresponding PartitionClient via an AtomicBool flag that callers check with is_revoked() - Update processor example to demonstrate is_revoked() usage
8f2fc95 to
390a0f6
Compare
Two fixes for EventProcessor partition management:
Add owner_level (epoch) support to EventProcessorBuilder. When set, the Event Hub broker enforces exclusive partition access by disconnecting any existing receiver when a new one connects with the same or higher owner level. This prevents duplicate processing during partition rebalancing.
Change DEFAULT_PARTITION_EXPIRATION_DURATION from 10s to 60s. The previous default was shorter than DEFAULT_UPDATE_INTERVAL (30s), causing all ownerships to expire before the next rebalance cycle. This made the load balancer always report current=0, continuously claiming new partitions and causing widespread duplicate processing.
fix #3851