Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Conversation

ploomiz
Copy link
Contributor

@ploomiz ploomiz commented May 4, 2022


labels: mergeable

Fixes: #issue

https://github.com/Eppo-exp/eppo/issues/2907

Motivation and Context

The SDK client needs retrieve assignment configurations (RAC) from Eppo's backend. It uses these assignment configurations to determine which variant a subject belongs to. The SDK polls the RAC endpoint at regular intervals to retrieve the configurations - see this design doc for more details.

Description

Implemented a poller and in-memory cache. It is almost the same implementation as was done for the Node SDK. The main difference is that, with multi-threaded language like Python, we need to synchronize access to the shared client instance and the configuration store.

How has this been tested?

  • Added an E2E test case in eppo_client_test.py that initializes the client and gets assignments.
  • Started a simple server that uses the get_instance and init methods. Verified that the Eppo backend API is called regularly on the poll interval and assigns variants to running Eppo experiments. Ran the server for about 1 hour.
  • Simulated a read timeout by pausing the RAC endpoint. Verified the client recovers and tries polling again on the next interval.

@ploomiz ploomiz self-assigned this May 4, 2022
@ploomiz ploomiz marked this pull request as ready for review May 4, 2022 17:47
@ploomiz ploomiz requested review from petzel and vpai May 4, 2022 17:48
@ploomiz
Copy link
Contributor Author

ploomiz commented May 5, 2022

@petzel I changed it to use an LRU Cache

@ploomiz ploomiz merged commit e3d0ac8 into main May 6, 2022
@ploomiz ploomiz deleted the polling branch May 6, 2022 03:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants