gruf 2.16.1 → 2.16.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f7ea5bc2b3a0c64008a565c470d19b948814f9c636ccdea72b93703f384ca77
4
- data.tar.gz: f5a23c82e85208104baec460d93f650e66189dfb3b27dc0c409dc32b21bcda4a
3
+ metadata.gz: f0508561578b2ebd6490bebfeeee8f4442d4bcec1d1cb877dc0005933564fc33
4
+ data.tar.gz: b4130a47d10681a4876046aa782640091799d99f433cc5f6ae55f6dce1f60ecf
5
5
  SHA512:
6
- metadata.gz: b227b3fc5253dbace401291e9643e2703244e9e83020d9516358ed78caef24f56668d61f9411f1b2dc25fa5854d711cc5b54346937f71d6835e00f98cd003e46
7
- data.tar.gz: 61f863b87320654ec2b247953b3817ae854ae4e601bc0c09206803a8cc2e453a8f80c77b0679b2cb03f870f5a0ba6c44ca8be8bc2ea6f1d34d0c03c7527b888b
6
+ metadata.gz: 1a9e198be4481b4e56c3e57fb7d76be2ce97e6cbe30368fadc990a505d1864c98f1e0d25f02c8209a0dafd89021537b15f6f12a83323ec3c8a7ff114c7c8094b
7
+ data.tar.gz: 5fc8489af23aa0e387aa84dc4104e7812aa0a767ddb32e6bf83f331442b79073f57c5ef97b2326ff9ec64cebf018d76589ce5f964bf67a69e758dd0780508423
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@ Changelog for the gruf gem. This includes internal history before the gem was ma
2
2
 
3
3
  ### Pending release
4
4
 
5
+ ### 2.16.2
6
+
7
+ * [#175] Fix code reload thread-safety. Calls to `Zeitwerk::Loader#setup` are now made in a thread-safe manner.
8
+
5
9
  ### 2.16.1
6
10
 
7
11
  * Fix issue where default gRPC health check was loaded even if unused or not desired; now only loaded when requested
@@ -47,7 +47,11 @@ module Gruf
47
47
  # Reload all files managed by the autoloader, if reloading is enabled
48
48
  #
49
49
  def reload
50
- @loader.reload if @reloading_enabled
50
+ if @reloading_enabled
51
+ reload_mutex do
52
+ @loader.reload
53
+ end
54
+ end
51
55
  end
52
56
 
53
57
  private
@@ -69,6 +73,17 @@ module Gruf
69
73
  @loader.eager_load
70
74
  @setup = true
71
75
  end
76
+
77
+ ##
78
+ # Handle thread-safe access to the loader
79
+ #
80
+ def reload_mutex(&block)
81
+ @reload_mutex ||= begin
82
+ require 'monitor'
83
+ Monitor.new
84
+ end
85
+ @reload_mutex.synchronize(&block)
86
+ end
72
87
  end
73
88
  end
74
89
  end
data/lib/gruf/version.rb CHANGED
@@ -16,5 +16,5 @@
16
16
  # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
17
  #
18
18
  module Gruf
19
- VERSION = '2.16.1'
19
+ VERSION = '2.16.2'
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.1
4
+ version: 2.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun McCormick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-17 00:00:00.000000000 Z
11
+ date: 2022-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler-audit