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

Issue with active_record.marshalling_format_version = 7.1 #371

Closed
JerrodCarpenter opened this issue Dec 28, 2024 · 2 comments
Closed

Issue with active_record.marshalling_format_version = 7.1 #371

JerrodCarpenter opened this issue Dec 28, 2024 · 2 comments

Comments

@JerrodCarpenter
Copy link

JerrodCarpenter commented Dec 28, 2024

As noted in this PR comment, it looks like there's an issue where the memo wise hash is sometimes not caught when using this new marshalling format version.

  Rails.application.config.active_record.marshalling_format_version = 7.1

This surfaces as NoMethodError: undefined method 'fetch' for nil

I've observed this behavior on version 1.7 and 1.10

@JerrodCarpenter
Copy link
Author

What's happening here is the new format for caching does not cache instance variables for active record objects. Thus the memo wise instance variable is nil and we see our NoMethodError. The Rails team discourages the caching of AR objects. However, it's been effective tool for our team. In our project we added some custom marshalling code to ensure the memo wise instance variable is cached and loaded from the cache appropriately. Anyways, closing this issue, as I think this is actually a weird side effect of Rails changing behavior and not a bug.

@JacobEvelyn
Copy link
Member

Thanks for the update @JerrodCarpenter !

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

No branches or pull requests

2 participants