-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move the compaction bug fix in
Circuit
to a separate module `RubyWi…
…thUnfixedCompaction` and move logic to the `Circuit` constructor instead of the `Compiler.` don't include this fix per default, as this is going to be fixed in Ruby 3.2.7 and 3.3.7.
- Loading branch information
Showing
3 changed files
with
59 additions
and
11 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
lib/trailblazer/activity/circuit/ruby_with_unfixed_compaction.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Trailblazer | ||
class Activity | ||
# TODO: we can remove this once we drop Ruby <= 3.3.6. | ||
class Circuit | ||
# This is a hot fix for Ruby versions that haven't fixed the GC compaction bug: | ||
# https://redmine.ruby-lang.org/issues/20853 | ||
# https://bugs.ruby-lang.org/issues/20868 | ||
# | ||
# Affected versions might be: 3.1.x, 3.2.?????????, 3.3.0-3.3.6 | ||
# You don't need this fix in the following versions: | ||
# | ||
# If you experience this bug: https://github.com/trailblazer/trailblazer-activity/issues/60 | ||
# | ||
# NoMethodError: undefined method `[]' for nil | ||
# | ||
# you need to do | ||
# | ||
# Trailblazer::Activity::Circuit.include(RubyWithUnfixedCompaction) | ||
module RubyWithUnfixedCompaction | ||
def initialize(wiring, *args, **options) | ||
wiring.compare_by_identity | ||
|
||
super(wiring, *args, **options) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains 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
This file contains 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