Open
Conversation
This was referenced Mar 24, 2026
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.
Context
As part of modernizing and unifying our Ruby on Rails stack we are bumping Ruby to 4.0.2, the latest stable version .
Implemented changes
Upgrade Ruby to 4.0.2 on all 5 repos (etengine, etmodel, etsource, etlocal, my-etm)
Additional we implemented a fix in
clone_datasetmethod, that in earlier versions of Ruby was kept hidden.The cause of this issue is that dataset.data contains the Lifecycle object, which holds @graph, which holds @dataset (a circular reference). The dataset also contains Proc objects stored via dataset_lazy_set. Under Ruby 4.0, Marshal.dump raises SystemStackError on this combination instead of TypeError, bypassing the rescue fallback in deep_clone and crashing the request (This being exposed after the Ruby 4.0 update).
Note: rescuing SystemStackError along with TypeError in deep_clone would also fix the crash by keeping it hidden from us like before and falling back to obj.deep_dup. But from what could find, this actually produces a shallow copy of the dataset, not a deep clone, I guess a deep copy is not needed if this works but by using Marshal I assume that was not the original intention.
Related
Goes with pull requests:
Checklist