Type error CdoTutorials can't be referred to - during initialize in database.rb#54703
Merged
Conversation
Hamms
approved these changes
Nov 9, 2023
Hamms
left a comment
Contributor
There was a problem hiding this comment.
Great investigation! Testing story makes sense to me as our best attempt at approximating what's going on in production.
I have a couple minor nitpicky questions about the precise implementation of this fix, but in general it LGTM; thank you! I'm excited to see what effect this has on our error rate 🤞
8 tasks
8 tasks
8 tasks
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.
Issue: TypeError thrown upon first instance of deserializing contents from cache for tables that are populated dynamically through data from CSV files.
More details:
Fix: Explicitly creating a new instance of the dynamic data models before cache look up to ensure the model is loaded.
Links
JIRA: https://codedotorg.atlassian.net/browse/ACQ-918?atlOrigin=eyJpIjoiOTlmMjYzNzExOTk0NDBkODhiMWI3OTA5M2I2MDY5MzQiLCJwIjoiaiJ9
Testing story
To repro this locally, I temporarily initialized the CDO.Cache object to a file store based cache instead of memory cache, so that cached data would persist between application restarts. With that change, observed the following behavior
uninitialized constant CdoTutorials
This test setup seemed to be hitting the same problem from the error message. With the change in this PR, the above scenario was successful in step #5
Deployment strategy
None - will keep close eye on HoneyBadger once this goes out in DTP
Follow-up work
Given the local repro isn't exactly the same as production, this change might not fix the underlying issue. If a drop in the HoneyBadger error isn't observed, will go back to evaluating a different solution.
Another solution we considered was to serialize and deserialize the cached data to JSON. Given the JSON conversion can be expensive in terms of time, I deprioritized that solution. But, will revisit if this doesn't help.
Privacy
N/A
Security
N/A
Caching
Issue is in cache retrieval, additional caching not applicable here
PR Checklist: