Skip to content

Commit

Permalink
Override RDF::URI in order to wrap the entire freeze method in mutex …
Browse files Browse the repository at this point in the history
…to try to prevent concurrent attempts to freeze the same URI (#1109)
  • Loading branch information
bbpennel authored Jul 22, 2024
1 parent b9eda36 commit ebae8b7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/overrides/lib/rdf/model/uri_override.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true
# [hyc-override] https://github.com/ruby-rdf/rdf/blob/3.2.11/lib/rdf/model/uri.rb
RDF::URI.class_eval do
# [hyc-override] Wrap the entire method in mutex, rather than just the interior of the unless block
def freeze
@mutex.synchronize do
unless frozen?
# Create derived components
authority; userinfo; user; password; host; port
@value = value.freeze
@object = object.freeze
@hash = hash.freeze
super
end
end
self
end
end

0 comments on commit ebae8b7

Please sign in to comment.