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

Resiliency: mark a service as used even if the getClient call during warmUp fails #1040

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

ZoabKapoor
Copy link
Contributor

Summary

We recently observed a bug with some users of D2 where:

  1. During warmUp all their calls to WarmUpLoadBalancer.getClient would time out due to the call in ZKDeterministicSubsettingMetadataProvider timing out.
  2. Because the service was added to the set of _usedServices after the getClient call, it would never be added
  3. Upon shutdown, that service was considered unused and its warm up backup store was deleted (even though it was eventually populated after warmUp).

This is wrong, as we should consider a service used even if the getClient call fails. I fixed this by moving the logic to add the service to the used services before making the getClient call instead of after

Testing done

Updated the unit test testNotDeletingFilesGetClient to test both the case where getClient returns and errors.

Before

Tests fail with

After shutdown there should be just one service, the one that we 'get the client' on
Expected :0
Actual   :1

After

Tests pass

@ZoabKapoor ZoabKapoor self-assigned this Feb 15, 2025
@ZoabKapoor ZoabKapoor requested review from bohhyang, PapaCharlie and brycezhongqing and removed request for bohhyang February 15, 2025 22:30
Copy link
Contributor

@bohhyang bohhyang left a comment

Choose a reason for hiding this comment

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

Nice catch and test! LGTM.

@ZoabKapoor ZoabKapoor merged commit a844338 into master Feb 18, 2025
2 checks passed
@ZoabKapoor ZoabKapoor deleted the fix_warmUp branch February 18, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants