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

fix(app_analytics/cache): use lock to make cache thread safe #4567

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

gagantrivedi
Copy link
Member

@gagantrivedi gagantrivedi commented Sep 2, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Use lock to make cache thread safe
fixes #4562

How did you test this code?

Tested manually to make sure two threads can't update _cache update at the same time

@gagantrivedi gagantrivedi requested a review from a team as a code owner September 2, 2024 06:24
@gagantrivedi gagantrivedi requested review from matthewelwell and removed request for a team September 2, 2024 06:24
Copy link

vercel bot commented Sep 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Sep 2, 2024 6:24am
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Sep 2, 2024 6:24am
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Sep 2, 2024 6:24am

Copy link

sentry-io bot commented Sep 2, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: api/app_analytics/cache.py

Function Unhandled Issue
_flush RuntimeError: dictionary changed size during iteration /api/v1/environment-doc...
Event Count: 2

Did you find this useful? React with a 👍 or 👎

@github-actions github-actions bot added the api Issue related to the REST API label Sep 2, 2024
Copy link
Contributor

github-actions bot commented Sep 2, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-4567 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-4567 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-4567 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-4567 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4567 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-e2e:pr-4567 Finished ✅ Skipped

@github-actions github-actions bot added the fix label Sep 2, 2024
Copy link
Contributor

github-actions bot commented Sep 2, 2024

Uffizzi Preview deployment-55782 was deleted.

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.14%. Comparing base (3b20df1) to head (cffc528).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4567   +/-   ##
=======================================
  Coverage   97.14%   97.14%           
=======================================
  Files        1154     1154           
  Lines       39811    39816    +5     
=======================================
+ Hits        38674    38679    +5     
  Misses       1137     1137           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gagantrivedi gagantrivedi added this pull request to the merge queue Sep 2, 2024
Merged via the queue into main with commit 8e371a8 Sep 2, 2024
35 checks passed
@gagantrivedi gagantrivedi deleted the fix/4562/cache-race-condition branch September 2, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RuntimeError: dictionary changed size during iteration
2 participants