legionio 1.5.12 → 1.5.13

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: 2b5d012d4df4a245648fe489a4c998c34fa209c119b74301d209f29cdeb44977
4
- data.tar.gz: 2f818144217a965f4353201773843cbfef1e151406b27996f6d493f144fa7de9
3
+ metadata.gz: 4815cb38dfcd2dc20af4e57d1ec14f63a9bf7876477b70fc11696b775685addf
4
+ data.tar.gz: 79f424e95bbe364be35ef6a1b5b11da3ef476dda096443a303b0d8136ffc79e5
5
5
  SHA512:
6
- metadata.gz: e436068fa3c9159a904fd9a57434916ad49a1e332b6220c2b89c290725094da4173aadea83c0656cccb564a05b0033521ad5ee37b6e0dc054eb83fa7facf2114
7
- data.tar.gz: d83cacb7a7afddfb35892ef4d1183c32cce83c64bfa53fed51d599b8eb04a99589af9fc1202a778a7389b257ea2c9fdd9a71010f2ebfb2c8b2b193b54fbe31fe
6
+ metadata.gz: 4edcd4fabaa737d35e6176668dc63cd6091533240f0ca038250b2b44652130590ad04ee144ed58df2eca1aa3d5313353b46a99069b42eefd2d224384694209a5
7
+ data.tar.gz: 16d72dd0db3df555b27defbe22fe1a3b27e2aa11d11674f57d89bc8de593f624aeb5c5ae6fcb589a5f085b0eea9619b0fd6ef56349cf749a3819210f5cc7b7ca
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Legion Changelog
2
2
 
3
+ ## [1.5.13] - 2026-03-25
4
+
5
+ ### Fixed
6
+ - API startup no longer spams Puma banner on port conflict — pre-checks port with lightweight TCP probe before attempting Puma boot
7
+ - Reduced API bind retries from 10 to 3 (6s total vs 30s) so boot completes quickly when port is occupied
8
+ - Daemon remains fully functional (shutdown, Ctrl+C) even when API fails to bind
9
+
3
10
  ## [1.5.12] - 2026-03-25
4
11
 
5
12
  ### Added
@@ -265,10 +265,12 @@ module Legion
265
265
 
266
266
  @api_thread = Thread.new do
267
267
  retries = 0
268
- max_retries = api_settings.fetch(:bind_retries, 10)
269
- retry_wait = api_settings.fetch(:bind_retry_wait, 3)
268
+ max_retries = api_settings.fetch(:bind_retries, 3)
269
+ retry_wait = api_settings.fetch(:bind_retry_wait, 2)
270
270
 
271
271
  begin
272
+ raise Errno::EADDRINUSE, "port #{port} already bound" if port_in_use?(bind, port)
273
+
272
274
  Legion::API.run!(traps: false)
273
275
  rescue Errno::EADDRINUSE
274
276
  retries += 1
@@ -630,6 +632,13 @@ module Legion
630
632
 
631
633
  private
632
634
 
635
+ def port_in_use?(bind, port)
636
+ TCPServer.new(bind, port).close
637
+ false
638
+ rescue Errno::EADDRINUSE
639
+ true
640
+ end
641
+
633
642
  def build_api_tls_config(api_settings)
634
643
  tls = api_settings[:tls] || {}
635
644
  tls = tls.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Legion
4
- VERSION = '1.5.12'
4
+ VERSION = '1.5.13'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legionio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.12
4
+ version: 1.5.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity