Rails app: NoMemoryError: Too deeply nested
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by locating the OJ_OPTIONS configuration referenced in the issue and inspect the existing serialization tests. Check whether the proposed compat mode and use_as_json setting reproduce or prevent the nested NoMemoryError, then run the relevant test suite; done means the Rails serialization path avoids the error without regressions.
Written by the indexing model from the issue text.
Description
When using Ruby on Rails I'm running into "NoMemoryError: Too deeply nested." with OJ's serialization within this gem. The suggested solution worked if I edited the OJ 'mode' to 'compat' and added the 'use_as_json' flag as follows:
OJ_OPTIONS = {
mode: :compat,
# use ruby's built-in serialization. If nil, OJ seems to default to ~15 decimal places of precision
float_precision: 0,
use_as_json: true
}.freeze
The fact that no one else runs into this makes me wonder if maybe there is something about Rails specifically that is causing this though haven't tracked it down. If it's possible to modify these OJ options for everyone and tests still pass it could be suggested as a solution.
I'm happy to offer a PR if it would be accepted.
- Dominant language
- Ruby
- Stars
- 287
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coinbase/temporal-ruby
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
coinbase/temporal-ruby#361 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
coinbase/temporal-ruby#341 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
coinbase/temporal-ruby#328 · 1 comment ·
-
NoMethodError when await_workflow_result is called for long running workflowsPossibly taken @iekundayo claimed this 718 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
coinbase/temporal-ruby#326 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
coinbase/temporal-ruby#324 · 3 comments · 2 reactions ·
All issues in coinbase/temporal-ruby
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ossf/best-practices-badge#3081 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
NatLabRockies/OpenStudio-HPXML#2284 ·
-
aikido security:critical
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dequelabs/axe-core-gems#532 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ossia/score-docs#97 · 1 comment ·