Skip to content

Update ruby4.0#1724

Open
aaccensi wants to merge 2 commits intomasterfrom
update-ruby4.0
Open

Update ruby4.0#1724
aaccensi wants to merge 2 commits intomasterfrom
update-ruby4.0

Conversation

@aaccensi
Copy link
Contributor

@aaccensi aaccensi commented Mar 24, 2026

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)

  • Made sure all repos are aligned using latest Bundler 4.0.6
  • Dockerfiles and version files updated
  • Specific gem bumps/fixes

Additional we implemented a fix in clone_dataset method, 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

  • I have tested these changes
  • I have updated documentation as needed
  • I have tagged the relevant people for review

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

Successfully merging this pull request may close these issues.

1 participant