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

Disambiguate missing cache values from None #1413

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

swrichards
Copy link
Collaborator

We have observed an issue with spurious cache hits in development, that we've been unable to reproduce so far. Looking into this did however prompt an audit of the caching decorator, which reveals we potentially have an issue where a cached "None" value is mis- interpreted as "not cached" rather than "cached as None". This commit clarifies the expected behaviour with a test and a more robust cache check.

@swrichards swrichards requested a review from pi-sigma September 26, 2024 13:21
@swrichards swrichards force-pushed the disambiguate-missing-cached-value-from-none branch from 5456e11 to c7f8524 Compare September 26, 2024 13:54
@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.89%. Comparing base (08e3b2a) to head (00a781b).
Report is 8 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1413   +/-   ##
========================================
  Coverage    94.88%   94.89%           
========================================
  Files         1046     1046           
  Lines        38605    38622   +17     
========================================
+ Hits         36631    36650   +19     
+ Misses        1974     1972    -2     
Flag Coverage Δ
94.89% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@swrichards swrichards force-pushed the disambiguate-missing-cached-value-from-none branch 2 times, most recently from 06219c0 to 7779680 Compare September 26, 2024 15:30
Copy link
Contributor

@pi-sigma pi-sigma left a comment

Choose a reason for hiding this comment

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

Typo in comment, otherwise looking good. Now we have to figure out the issue with wrong cache hits...

src/open_inwoner/utils/tests/test_utils.py Outdated Show resolved Hide resolved
@swrichards swrichards force-pushed the disambiguate-missing-cached-value-from-none branch from 7779680 to fddef29 Compare September 30, 2024 07:09
We have observed an issue with spurious cache hits in development,
that we've been unable to reproduce so far. Looking into this did
however prompt an audit of the caching decorator, which reveals
we potentially have an issue where a cached "None" value is mis-
interpreted as "not cached" rather than "cached as None". This
commit clarifies the expected behaviour with a test and a more
robust cache check.
@swrichards swrichards force-pushed the disambiguate-missing-cached-value-from-none branch from fddef29 to 00a781b Compare September 30, 2024 07:10
@alextreme alextreme merged commit fdb51bb into develop Sep 30, 2024
20 checks passed
@alextreme alextreme deleted the disambiguate-missing-cached-value-from-none branch September 30, 2024 09:20
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.

4 participants