Skip to content
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

[Event Hubs] Add a 20% random jitter to the EP load balancing interval. #9713

Merged
merged 1 commit into from
Mar 6, 2020

Conversation

YijunXieMS
Copy link
Contributor

This PR is related to #9575

@@ -310,6 +311,8 @@ def _create_tasks_for_claimed_ownership(
if not self._running:
self._running = True
while self._running:
random_jitter = self._load_balancing_interval * random.random() * 0.2
Copy link
Contributor

@yunhaoling yunhaoling Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems Java gives a fixed base jitter (2 seconds) time and use n * BASE (n in [0,1]) as the final jitter.
https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventProcessorClient.java#L43

So it's
load_balancing_interval * (1 + ratio) VS load_balancing_interval + ratio * base_jitter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fixed base jitter 2 seconds would be too large if the load balancing interval is small. A propotional value is better I think. Java fixes the interval at 10 so the base jitter is 2, not a proportional value.

@YijunXieMS
Copy link
Contributor Author

/azp run python - eventhubs - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@YijunXieMS YijunXieMS merged commit e09c723 into Azure:master Mar 6, 2020
openapi-sdkautomation bot referenced this pull request in AzureSDKAutomation/azure-sdk-for-python Jun 4, 2020
update (#9713)

Co-authored-by: Yingying Song <yison@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants