ears 0.26.1 → 0.27.0
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 +6 -0
- data/Gemfile.lock +2 -2
- data/lib/ears/publisher_channel_pool.rb +7 -23
- data/lib/ears/publisher_confirmation_handler.rb +1 -3
- data/lib/ears/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: 734c223f712b45458b8ff4e708b2f5357c434bd04e7fa8484a1b8af1eb864704
|
|
4
|
+
data.tar.gz: c73c51588a43bbc02772b0ba9a5b1afde23568e2b72da4aa77e992333ed4332c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de36a79e2994349c4d6156857d3fd49e380ae224341c0a7476c3ae45a651f9ca17375e69984d3b0a762c30c2815c06933372baabc18364c95a4ec1d4ce9f2f3a
|
|
7
|
+
data.tar.gz: 14425c85eada0c363fc0f3be960df6adfad43a52ae502261eb7aad8f9a3bc98f8a76f2a00fa9e96595002c1783cfcb85ea1394914306ff3f25c9e9f8ddd45483
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.27.0 (2026-10-02)
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- A publisher channel that is closed when it is returned to the pool is now discarded instead of resetting the whole pool. A failed publish confirmation no longer closes the channels other threads are publishing on.
|
|
8
|
+
|
|
3
9
|
## 0.26.1 (2026-10-01)
|
|
4
10
|
|
|
5
11
|
### Fixed
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ears (0.
|
|
4
|
+
ears (0.27.0)
|
|
5
5
|
bunny (>= 3.0.0)
|
|
6
6
|
connection_pool (~> 3.0)
|
|
7
7
|
json (>= 2.9.0)
|
|
@@ -102,7 +102,7 @@ CHECKSUMS
|
|
|
102
102
|
bunny (3.3.0) sha256=85ef5562ec2b24f542e8fad69c4302d30d966fb79ff803dc9d0c398a4054672a
|
|
103
103
|
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
|
|
104
104
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
105
|
-
ears (0.
|
|
105
|
+
ears (0.27.0)
|
|
106
106
|
json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
|
|
107
107
|
language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
|
|
108
108
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
@@ -18,8 +18,14 @@ module Ears
|
|
|
18
18
|
|
|
19
19
|
pool = confirms ? confirms_pool : standard_pool
|
|
20
20
|
pool.with do |channel|
|
|
21
|
-
|
|
21
|
+
unless channel.open?
|
|
22
|
+
raise PublisherRetryHandler::PublishToStaleChannelError,
|
|
23
|
+
'Channel is closed'
|
|
24
|
+
end
|
|
25
|
+
|
|
22
26
|
block.call(channel)
|
|
27
|
+
ensure
|
|
28
|
+
pool.discard_current_connection unless channel.open?
|
|
23
29
|
end
|
|
24
30
|
end
|
|
25
31
|
|
|
@@ -102,33 +108,11 @@ module Ears
|
|
|
102
108
|
@init_mutex ||= Mutex.new
|
|
103
109
|
end
|
|
104
110
|
|
|
105
|
-
def validate_channel_health!(channel, confirms)
|
|
106
|
-
return if channel.open?
|
|
107
|
-
|
|
108
|
-
cleanup_closed_channel(channel)
|
|
109
|
-
reset_appropriate_pool(confirms)
|
|
110
|
-
|
|
111
|
-
raise PublisherRetryHandler::PublishToStaleChannelError,
|
|
112
|
-
'Channel is closed'
|
|
113
|
-
end
|
|
114
|
-
|
|
115
111
|
def close_channel(channel)
|
|
116
112
|
channel.close
|
|
117
113
|
rescue Bunny::ChannelAlreadyClosed
|
|
118
114
|
nil
|
|
119
115
|
end
|
|
120
|
-
|
|
121
|
-
def cleanup_closed_channel(channel)
|
|
122
|
-
return unless channel.respond_to?(:close)
|
|
123
|
-
|
|
124
|
-
channel.close
|
|
125
|
-
rescue StandardError
|
|
126
|
-
# Channel is already closed, ignore cleanup errors
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
def reset_appropriate_pool(confirms)
|
|
130
|
-
confirms ? reset_confirms_pool! : reset!
|
|
131
|
-
end
|
|
132
116
|
end
|
|
133
117
|
end
|
|
134
118
|
end
|
|
@@ -4,7 +4,7 @@ module Ears
|
|
|
4
4
|
# Handles publisher confirmations for RabbitMQ messages.
|
|
5
5
|
#
|
|
6
6
|
# This class encapsulates the logic for publishing messages with confirmations,
|
|
7
|
-
# including timeout handling
|
|
7
|
+
# including timeout handling and channel cleanup.
|
|
8
8
|
class PublisherConfirmationHandler
|
|
9
9
|
# Creates a new confirmation handler.
|
|
10
10
|
#
|
|
@@ -72,8 +72,6 @@ module Ears
|
|
|
72
72
|
warn("Failed closing channel on failed confirmation: #{e.message}")
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
PublisherChannelPool.reset_confirms_pool!
|
|
76
|
-
|
|
77
75
|
if channel.nacked_set&.any?
|
|
78
76
|
warn('Publisher confirmation failed: message was nacked by broker.')
|
|
79
77
|
raise PublishNacked, 'Message was nacked by broker'
|
data/lib/ears/version.rb
CHANGED