Local evaluation with multiprocessing environment

Open
#77 0 comments 1 reaction 2 assignees View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

bug

What

When running the client with local evaluation in a gunicorn server (or any multiprocessed environment), the workers environment is never updated

Why

Gunicorn is designed around the pre-fork worker model (see docs). When instantiating the Flagsmith client, the polling updates the _environment variable in the master worker, but these changes will not affect the other workers. We would need to run a polling thread for each worker, which is not ideal

Sharing the _environment between workers

Would you be open to a new feature that would allow pickling and sharing the data between processes using a multiprocessing.Manager or a redis?

Dominant language
Python
Stars
24
Forks
12
Avg merge
15h 43m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Flagsmith/flagsmith-python-client

All issues in Flagsmith/flagsmith-python-client

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.