legion-transport 1.4.29 → 1.4.30

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0715340440c095820ecfb74c6b8ae40a83fe80b91f0f955b03738025d96b4c0
4
- data.tar.gz: 9268e04ea467e4dfa0c88fb06398c24f3ec45896cdffbc8c8279a25f4f59c9cc
3
+ metadata.gz: f6143d2993acf25fc55bce28552b4c92e005b4835bd0431dc1f34483022fd29f
4
+ data.tar.gz: 83cc2c75cf8d799e8e79b721e2b252520f74b5daea593161db921cba5d14386c
5
5
  SHA512:
6
- metadata.gz: ea10e1f938c6d45ec84264bfd966fb3b927e85af51d7c083fda2de083b5cb438d8910f4c10d01045bec232f11a47a9d2934c19c1f65a586ce85ab568cb6173d4
7
- data.tar.gz: 74d46d188320c325787b953a2a177bd75041220f718e3f101e56da58c0d5a0ea52f361e5d10eb8e0f61959847a2ba9eb5e4bb795ab0ec579c0b24245e4ebdcbe
6
+ metadata.gz: 4705576bed71ba1cdf4fd2d69eedf36fce852cf654f6dc5bcf1b4c16cedb75b4e8163328f097de57400684a4afce808785aa46bfb7a46aae4999e9bc5fc69322
7
+ data.tar.gz: 125eaffbcfed0dd34957e753836db2a3050772f54b7dfc76b5c9cf8cd82a45708e37c40444004ae5c3c49ea91a1631b23062b6277ebaedab722fc8bc06032994
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.4.30] - 2026-07-31
6
+
7
+ ### Fixed
8
+ - Fixed DLX recovery loop (`Bunny::ChannelAlreadyClosed` on `legion.*.dlx` exchanges and queues). The `declare_dlx` method recorded DLX topology on a short-lived channel that was immediately closed after declaration; Bunny's automatic recovery then repeatedly attempted to re-declare on the dead channel, looping forever. Now uses `exchange_declare_without_recording_topology` and `queue_declare_without_recording_topology` so the DLX (durable on the server) is not tracked for client-side recovery. Also added explicit `ChannelAlreadyClosed` handling in `ensure_dlx` and `recreate_dlx` to fail once with context instead of looping.
9
+
5
10
  ## [1.4.29] - 2026-05-22
6
11
 
7
12
  ### Added
@@ -89,12 +89,18 @@ module Legion
89
89
  dlx_name = merged_options.dig(:arguments, :'x-dead-letter-exchange')
90
90
  return if dlx_name.nil? || dlx_name.empty?
91
91
 
92
+ session = Legion::Transport::Connection.session
93
+ return unless session&.open?
94
+
92
95
  dlx_ch = nil
93
- dlx_ch = Legion::Transport::Connection.session.create_channel
96
+ dlx_ch = session.create_channel
94
97
  declare_dlx(dlx_name, dlx_ch)
95
98
  rescue Legion::Transport::CONNECTOR::PreconditionFailed => e
96
99
  handle_exception(e, level: :warn, handled: true, operation: 'transport.queue.ensure_dlx', dlx: dlx_name)
97
100
  recreate_dlx(dlx_name)
101
+ rescue Legion::Transport::CONNECTOR::ChannelAlreadyClosed => e
102
+ handle_exception(e, level: :warn, handled: true, operation: 'transport.queue.ensure_dlx',
103
+ dlx: dlx_name, detail: 'channel closed during DLX declaration')
98
104
  rescue StandardError => e
99
105
  handle_exception(e, level: :warn, handled: true, operation: 'transport.queue.ensure_dlx', dlx: dlx_name)
100
106
  ensure
@@ -102,9 +108,9 @@ module Legion
102
108
  end
103
109
 
104
110
  def declare_dlx(dlx_name, dlx_channel)
105
- dlx_channel.exchange_declare(dlx_name, 'fanout', durable: true, auto_delete: false)
106
- dlx_channel.queue_declare("#{dlx_name}.queue", durable: true, auto_delete: false,
107
- arguments: { 'x-queue-type': 'classic' })
111
+ dlx_channel.exchange_declare_without_recording_topology(dlx_name, 'fanout', durable: true, auto_delete: false)
112
+ dlx_channel.queue_declare_without_recording_topology("#{dlx_name}.queue", durable: true, auto_delete: false,
113
+ arguments: { 'x-queue-type': 'classic' })
108
114
  dlx_channel.queue_bind("#{dlx_name}.queue", dlx_name, routing_key: '#')
109
115
  end
110
116
 
@@ -116,6 +122,9 @@ module Legion
116
122
  ch.close
117
123
  ch = Legion::Transport::Connection.session.create_channel
118
124
  declare_dlx(dlx_name, ch)
125
+ rescue Legion::Transport::CONNECTOR::ChannelAlreadyClosed => e
126
+ handle_exception(e, level: :error, handled: true, operation: 'transport.queue.recreate_dlx',
127
+ dlx: dlx_name, detail: 'session channel unavailable during DLX recreation')
119
128
  rescue StandardError => e
120
129
  handle_exception(e, level: :warn, handled: true, operation: 'transport.queue.recreate_dlx', dlx: dlx_name)
121
130
  ensure
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Transport
5
- VERSION = '1.4.29'
5
+ VERSION = '1.4.30'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.29
4
+ version: 1.4.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity