legion-transport 1.4.26 → 1.4.27
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/CHANGELOG.md +5 -0
- data/lib/legion/transport/connection.rb +8 -6
- data/lib/legion/transport/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: 34f1262388f94d320591c4626c44d07d7da821d89d0ccf7667daa6447c21902d
|
|
4
|
+
data.tar.gz: 47bb88de9f7f28684dee8b96fe62d91eca3c766bd232bcf895a1cf7426482037
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bbc69ae6b29a4ce61f47d81b326b7ff5f915939bbc88702c8e7df2f52fd9bb9cf9e1f155659d1b294ece6e0ab9cac56694d8ca8f5920f7938c6eec35942e7c2
|
|
7
|
+
data.tar.gz: 1e989cbb8273f1877f35b264512269e6d8ba5db1180153c2b2f8cff169c15005c76ee1390bd5d6c4cff97267dad65840b6cd2d28f2abbe9a815d85e2d7b4b5e3
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [1.4.27] - 2026-05-17
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Fixed race condition in channel registry iteration: `sweep_dead_thread_channels` and `close_all_tracked_channels` used `.each` on the live hash while parallel boot threads (`hook_subscription_actors_pooled`) concurrently called `track_channel`, raising `"can't add a new key into hash during iteration"` on Ruby 3.4. Replaced with `.keys.each` which snapshots the key list into an Array before iterating.
|
|
9
|
+
|
|
5
10
|
## [1.4.26] - 2026-05-16
|
|
6
11
|
|
|
7
12
|
### Fixed
|
|
@@ -301,12 +301,12 @@ module Legion
|
|
|
301
301
|
@channel_registry ||= Concurrent::Hash.new
|
|
302
302
|
return if @channel_registry.empty?
|
|
303
303
|
|
|
304
|
-
@channel_registry.
|
|
305
|
-
channel
|
|
304
|
+
@channel_registry.keys.each do |thread| # rubocop:disable Style/HashEachMethods
|
|
305
|
+
channel = @channel_registry.delete(thread)
|
|
306
|
+
channel&.close if channel&.open?
|
|
306
307
|
rescue StandardError => e
|
|
307
308
|
handle_exception(e, level: :warn, handled: true, operation: 'transport.connection.close_tracked_channel')
|
|
308
309
|
end
|
|
309
|
-
@channel_registry.clear
|
|
310
310
|
end
|
|
311
311
|
|
|
312
312
|
def sweep_dead_thread_channels
|
|
@@ -314,14 +314,16 @@ module Legion
|
|
|
314
314
|
return if @channel_registry.empty?
|
|
315
315
|
|
|
316
316
|
swept = 0
|
|
317
|
-
@channel_registry.each do |thread
|
|
317
|
+
@channel_registry.keys.each do |thread| # rubocop:disable Style/HashEachMethods
|
|
318
318
|
next if thread&.alive?
|
|
319
319
|
|
|
320
|
-
|
|
320
|
+
channel = @channel_registry.delete(thread)
|
|
321
|
+
next unless channel
|
|
322
|
+
|
|
323
|
+
if channel.open?
|
|
321
324
|
channel.close
|
|
322
325
|
swept += 1
|
|
323
326
|
end
|
|
324
|
-
@channel_registry.delete(thread)
|
|
325
327
|
rescue StandardError => e
|
|
326
328
|
@channel_registry.delete(thread)
|
|
327
329
|
handle_exception(e, level: :warn, handled: true, operation: 'transport.connection.sweep_channel')
|