protobuf-nats 0.13.0.pre0 → 0.13.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/protobuf/nats/response_muxer.rb +11 -1
- data/lib/protobuf/nats/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b7aca0b48165949df0d4bf25caaf232c6fa0b27f8e56337731a155bab46526f
|
|
4
|
+
data.tar.gz: 7d6b68fcdc13f8561fa9d8f20c8c90049df3535ca70532265fbabcaa97ed243d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0ce6f5d3599b7c62ce1e6b518108ccb0e32b8c913ecdb3a21a0c43a4a71f1636407d07432ae49a615c4e98f7104dad82de86001bc20f48d8c657e4fab926af88
|
|
7
|
+
data.tar.gz: 739ec4501bcfcd5080c000abfc4cec9eaf0ae33ae906f5bb63d259e4e473176a82123a39f5c396f0ae1190c1b548c0cf402de1f9edc4454b43e6c10f6bfb416a
|
|
@@ -125,6 +125,13 @@ module Protobuf
|
|
|
125
125
|
@restarting = true
|
|
126
126
|
end
|
|
127
127
|
|
|
128
|
+
# Yield so other restart callers spawned around the same time get a
|
|
129
|
+
# chance to reach the @restarting check above and skip. Without this,
|
|
130
|
+
# CRuby's GVL can let the current thread run the entire restart to
|
|
131
|
+
# completion (clearing @restarting) before sibling threads even enter
|
|
132
|
+
# the method, defeating the concurrent-restart guard.
|
|
133
|
+
Thread.pass
|
|
134
|
+
|
|
128
135
|
begin
|
|
129
136
|
# Stop the existing muxer first, if it's running
|
|
130
137
|
LOCK.synchronize do
|
|
@@ -358,7 +365,6 @@ module Protobuf
|
|
|
358
365
|
|
|
359
366
|
@cleanup_mutex.synchronize { @shutdown = false }
|
|
360
367
|
@cleanup_thread = Thread.new do
|
|
361
|
-
Thread.current.name = "response-muxer-cleanup-#{object_id}"
|
|
362
368
|
begin
|
|
363
369
|
loop do
|
|
364
370
|
# Wait for 60 seconds or until signaled to shutdown
|
|
@@ -380,6 +386,10 @@ module Protobuf
|
|
|
380
386
|
::Protobuf::Nats.notify_error_callbacks(fatal_error)
|
|
381
387
|
end
|
|
382
388
|
end
|
|
389
|
+
# Name the thread from the outside so the name is visible to callers
|
|
390
|
+
# immediately after start_cleanup_thread returns (no race with the
|
|
391
|
+
# thread body executing).
|
|
392
|
+
@cleanup_thread.name = "response-muxer-cleanup-#{object_id}"
|
|
383
393
|
end
|
|
384
394
|
|
|
385
395
|
def stop_cleanup_thread
|