Skip to content

guard against web.ctx.features AttributeError in cache contexts #10526

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

Merged
merged 9 commits into from
Mar 3, 2025

Conversation

mekarpeles
Copy link
Member

@mekarpeles mekarpeles commented Mar 1, 2025

Guard against the features.is_enabled failures in cache (when recomputed in threads), check hasattr(web, 'ctx')

  • should only work on testing/prod if queryparam matches value for debug feature.

Closes #10341

Technical

Tested on mek / staging.

See technical notes here

Testing

Confirmed debug page still works (may require a few attempts to trigger solr timeout, requires correct debug key) https://openlibrary.org/search?q=language:eng&debug=xxx

Screenshot

Stakeholders

Guard against the `features.is_enabled` check failures by ensuring `web.ctx` is hydrated in contexts where memcached is recomputed in a separate thread by using `delegate.fakeload()` to hydrate `web.ctx`.
@github-actions github-actions bot added the Priority: 2 Important, as time permits. [managed] label Mar 1, 2025
@mekarpeles mekarpeles added the Patch Deployed This PR has been deployed to production independently, outside of the regular deploy cycle. label Mar 1, 2025
@mekarpeles mekarpeles assigned cdrini and unassigned jimchamp Mar 1, 2025
@cdrini cdrini removed the Patch Deployed This PR has been deployed to production independently, outside of the regular deploy cycle. label Mar 1, 2025
@mekarpeles mekarpeles merged commit bd3ffaa into master Mar 3, 2025
7 checks passed
@mekarpeles mekarpeles deleted the 10341/hotfix/web-ctx-features-fakeload branch March 3, 2025 20:08
@mekarpeles
Copy link
Member Author

@cdrini approved via ABC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 2 Important, as time permits. [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate production ThreadedDict AttributeErrors
3 participants