Skip to content

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 PapaCharlie, bohhyang 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
dg-builder pushed a commit to dg-builder/rest.li that referenced this pull request Sep 2, 2025
…warmUp fails (linkedin#1040)

* Mark service as _usedService regardless of whether getClient call succeeds

* Update changelog

* Remove empty test (added mistakenly)
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.

3 participants