Move web.ctx check outside of cached function #10318#10353
Merged
mekarpeles merged 2 commits intomasterfrom Jan 17, 2025
Merged
Move web.ctx check outside of cached function #10318#10353mekarpeles merged 2 commits intomasterfrom
mekarpeles merged 2 commits intomasterfrom
Conversation
Moves `("dev" in web.ctx.features)` check to a `devmode` function param so `web.ctx` is no longer needed within our cached function.
While the initial computer of the `get_homepage()` function works fine (because `web.ctx` is in scope) the `web.ctx` `ThreadedDict` may no longer be accessible once passed to a memcache thread for it's subsequent re-compute after timeout hit)
cdrini
approved these changes
Jan 17, 2025
Collaborator
cdrini
left a comment
There was a problem hiding this comment.
Lgtm, great sleuthing! Mek tested on testing / patch deployed
Co-authored-by: Drini Cami <cdrini@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves
("dev" in web.ctx.features)check to adevmodefunction param soweb.ctxis no longer needed within our cached function.While the initial computer of the
get_homepage()function works fine (becauseweb.ctxis in scope) theweb.ctxThreadedDictmay no longer be accessible once passed to a memcache thread for it's subsequent re-compute after timeout hit)Closes #10318
Resolves https://sentry.archive.org/organizations/ia-ux/issues/541018/?query=is%3Aunresolved+threadeddict&referrer=issue-stream&statsPeriod=14d
Addresses instance of #10341
Technical
See investigation here: #10318 (comment)
Testing
hotfix patch deploy should show a drop in errors on sentry and hopefully stats showing up again on prod.
Stakeholders
@schu96 @cdrini @RayBB @jimchamp