parent
3144928494
commit
60be59131a
@ -1,2 +1,3 @@
|
|||||||
/activesupport-*.gem
|
/activesupport-*.gem
|
||||||
/activesupport-*-tests.tgz
|
/activesupport-*-tests.txz
|
||||||
|
/rails-*-tools.txz
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
From 4f4f8a705a8e713bceee8cacca52e9bce22e28dc Mon Sep 17 00:00:00 2001
|
|
||||||
From: "yuuji.yaginuma" <yuuji.yaginuma@gmail.com>
|
|
||||||
Date: Wed, 18 Dec 2019 19:00:29 +0900
|
|
||||||
Subject: [PATCH] Make `LoadInterlockAwareMonitor` work in Ruby 2.7
|
|
||||||
|
|
||||||
Currently `LoadInterlockAwareMonitorTest` does not pass with Ruby 2.7 [1].
|
|
||||||
This is due to the refactoring of the `monitor` done in Ruby 2.7 [2].
|
|
||||||
|
|
||||||
With this refactoring, the behavior of the method has changed from the
|
|
||||||
expected behavior in `LoadInterlockAwareMonitor`.
|
|
||||||
|
|
||||||
This patch also overwrites `synchronize` so that
|
|
||||||
`LoadInterlockAwareMonitor` works as expected.
|
|
||||||
|
|
||||||
[1]: https://buildkite.com/rails/rails/builds/65877#eec47af5-7595-47cb-97c0-30c589716176/996-2743
|
|
||||||
[2]: https://bugs.ruby-lang.org/issues/16255
|
|
||||||
---
|
|
||||||
.../load_interlock_aware_monitor.rb | 18 ++++++++++++++++++
|
|
||||||
1 file changed, 18 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb b/activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb
|
|
||||||
index a8455c00483f..480c34c64017 100644
|
|
||||||
--- a/activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb
|
|
||||||
+++ b/activesupport/lib/active_support/concurrency/load_interlock_aware_monitor.rb
|
|
||||||
@@ -7,11 +7,29 @@ module Concurrency
|
|
||||||
# A monitor that will permit dependency loading while blocked waiting for
|
|
||||||
# the lock.
|
|
||||||
class LoadInterlockAwareMonitor < Monitor
|
|
||||||
+ EXCEPTION_NEVER = { Exception => :never }.freeze
|
|
||||||
+ EXCEPTION_IMMEDIATE = { Exception => :immediate }.freeze
|
|
||||||
+ private_constant :EXCEPTION_NEVER, :EXCEPTION_IMMEDIATE
|
|
||||||
+
|
|
||||||
# Enters an exclusive section, but allows dependency loading while blocked
|
|
||||||
def mon_enter
|
|
||||||
mon_try_enter ||
|
|
||||||
ActiveSupport::Dependencies.interlock.permit_concurrent_loads { super }
|
|
||||||
end
|
|
||||||
+
|
|
||||||
+ def synchronize
|
|
||||||
+ Thread.handle_interrupt(EXCEPTION_NEVER) do
|
|
||||||
+ mon_enter
|
|
||||||
+
|
|
||||||
+ begin
|
|
||||||
+ Thread.handle_interrupt(EXCEPTION_IMMEDIATE) do
|
|
||||||
+ yield
|
|
||||||
+ end
|
|
||||||
+ ensure
|
|
||||||
+ mon_exit
|
|
||||||
+ end
|
|
||||||
+ end
|
|
||||||
+ end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,2 +1,3 @@
|
|||||||
SHA512 (activesupport-5.2.3.gem) = 8e0ab698f1b850c380ffc464fd48c942f4a46b9ca66055166949fa069740a4ff50f320d87f1040064a896c5ba1b8c00f0730592efec90d92a20c500d66b99589
|
SHA512 (activesupport-6.0.3.1.gem) = b4b80a2fd08f4dc62a22b8946a91e81116e07a275d2ab75cb7021aa8f3481816ce32b5a598eb532235fe2e686cb1a000fad1667ab4d9561cd01a7e682244f6f8
|
||||||
SHA512 (activesupport-5.2.3-tests.tgz) = 853650145304f21d37172097d8fa31866a33d754a61bcc4bebcb51e4ad4cda58d6757d2526ff073118cf3cd56494b93857050a9e2f1ea08ea0e361b7fec32be7
|
SHA512 (activesupport-6.0.3.1-tests.txz) = 38e34723040d209fb11aaf6b7c01a4e6bafceb1c6a53417dffc2f154996ba66cf80775b2e6f040548920537f27057c19bd3f09493a4de0bf99eb70be4ce2b6a3
|
||||||
|
SHA512 (rails-6.0.3.1-tools.txz) = e461674faf787a4f488e93b43747f829b9ea764167ac4782190ac469c4b0941e307e0a72b786a8392c00df1221d02622ffd4b29d7ea43e6c018daf463e092f6a
|
||||||
|
Loading…
Reference in new issue