einhorn 1.0.1 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf1c281da283b0ee43ed8cbaeddb906c1804a28a4cbbbb48fd6d7ec9840491a6
4
- data.tar.gz: 18642e07afb648a5d00e0b9006f9331496353ca719928a50a2c1cf340372c6cd
3
+ metadata.gz: 7c72e94fac54aab8b659b1a0f0541f0be46a11dfc50741c14cc76b2ec724f813
4
+ data.tar.gz: 2feaded9e2d03cdafaa7627966873d1e4dd3690645aa210e7b2a5d02a03dd2c0
5
5
  SHA512:
6
- metadata.gz: 7660f7388e99b82efb48444ffeebfc776b3a3df2f51a4f87e56b85381cbe1993958601dd2c24a88438755074952c6b326ce1ba895d1c769924e028ca98b90bff
7
- data.tar.gz: 876641c4e3e32668aca676c0636786c2dfd2ed1d4d0cc5b9fc33bf01c9d1c6c60d128719deb7a98f20432fbd7982069bdc8cb52bff59b7a73a6dbf7379f09973
6
+ metadata.gz: b34e73f9444fae30f6b799d4686caa30040a8c3cdd8bfa6be4b65c3c4b6fb1ec18c3d676df97fa697621878b4da1e9ad9398fe1a05760b6bef7c6ed2cc82d936
7
+ data.tar.gz: 699d684f1a97051f83f7047a4ec43a55ac7c96f939f9d92513d0c36dbcfc9cfed3133b077f0160de5f5f132907b8778471a2d1091e8c27f1edd91b4d3ea14bfd
data/Changes.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 1.1.0
2
+
3
+ - Add `logger` and `readline` gem dependencies for Ruby 4.0
4
+ - Make the `fiddle` gem dependency optional.
5
+ This gem is only necessary if you use the `-k` flag and since
6
+ it is native, requires libffi and a compiler to be installed.
7
+ Add `gem "fiddle"` to your Gemfile to use the `-k` flag.
8
+
1
9
  # 1.0.1
2
10
 
3
11
  - Add `fiddle` to gemspec dependencies [#111]
data/README.md CHANGED
@@ -200,7 +200,7 @@ Then you could set `--reexec-as=` to the name of your bash script and it will ru
200
200
  -f, --lockfile LOCKFILE Where to store the Einhorn lockfile
201
201
  -g, --command-socket-as-fd Leave the command socket open as a file descriptor, passed in the EINHORN_SOCK_FD environment variable. This allows your worker processes to ACK without needing to know where on the filesystem the command socket lives.
202
202
  -h, --help Display this message
203
- -k, --kill-children-on-exit If Einhorn exits unexpectedly, gracefully kill all its children
203
+ -k, --kill-children-on-exit If Einhorn exits unexpectedly, gracefully kill all its children (linux only, requires the fiddle gem)
204
204
  -l, --backlog N Connection backlog (assuming this is a server)
205
205
  -m, --ack-mode MODE What kinds of ACK to expect from workers. Choices: FLOAT (number of seconds until assumed alive), manual (process will speak to command socket when ready). Default is MODE=1.
206
206
  -n, --number N Number of copies to spin up
data/bin/einhorn CHANGED
@@ -227,6 +227,14 @@ if true # $0 == __FILE__
227
227
  end
228
228
 
229
229
  opts.on('-k', '--kill-children-on-exit', 'If Einhorn exits unexpectedly, gracefully kill all its children') do
230
+ # Fiddle is only necessary for this feature flag.
231
+ # Since fiddle is our only native dependency and we don't want to force
232
+ # a compiler on everyone, we make it optional.
233
+ begin
234
+ require "fiddle"
235
+ rescue LoadError
236
+ warn "Please add `gem 'fiddle'` to your Gemfile to use einhorn's -k flag"
237
+ end
230
238
  Einhorn::State.kill_children_on_exit = true
231
239
  end
232
240
 
data/einhorn.gemspec CHANGED
@@ -25,5 +25,8 @@ Gem::Specification.new do |gem|
25
25
  gem.add_development_dependency "minitest", "~> 5"
26
26
  gem.add_development_dependency "mocha", "~> 2"
27
27
  gem.add_development_dependency "subprocess", "~> 1"
28
- gem.add_dependency "fiddle", "~> 1.1"
28
+ # Fiddle is native and only needed for `-k` on Linux so we make it optional
29
+ # gem.add_dependency "fiddle", "~> 1.1"
30
+ gem.add_dependency "logger"
31
+ gem.add_dependency "readline"
29
32
  end
@@ -297,7 +297,7 @@ module Einhorn::Command
297
297
  # Used by einhornsh
298
298
  command "ehlo" do |conn, request|
299
299
  <<~EOF
300
- Welcome, #{request["user"]}! You are speaking to Einhorn Master Process #{$$}#{Einhorn::State.cmd_name ? " (#{Einhorn::State.cmd_name})" : ""}.
300
+ Welcome, #{request["user"]}! You are speaking to Einhorn Master Process #{$$}#{" (#{Einhorn::State.cmd_name})" if Einhorn::State.cmd_name}.
301
301
  This is Einhorn #{Einhorn::VERSION}.
302
302
  EOF
303
303
  end
@@ -4,6 +4,7 @@ require "fiddle/import"
4
4
  module Einhorn
5
5
  module PrctlRaw
6
6
  extend Fiddle::Importer
7
+
7
8
  dlload Fiddle.dlopen(nil) # libc
8
9
  extern "int prctl(int, unsigned long, unsigned long, unsigned long, unsigned long)"
9
10
 
@@ -1,3 +1,3 @@
1
1
  module Einhorn
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
data/lib/einhorn.rb CHANGED
@@ -94,6 +94,7 @@ module Einhorn
94
94
 
95
95
  module TransientState
96
96
  extend AbstractState
97
+
97
98
  def self.default_state
98
99
  {
99
100
  whatami: :master,
@@ -307,7 +308,7 @@ module Einhorn
307
308
  end
308
309
 
309
310
  ARGV[0..-1] = cmd[idx + 1..-1]
310
- log_info("Set#{set_ps_name ? " $0 = #{$0.inspect}, " : nil} ARGV = #{ARGV.inspect}")
311
+ log_info("Set#{" $0 = #{$0.inspect}, " if set_ps_name} ARGV = #{ARGV.inspect}")
311
312
  end
312
313
 
313
314
  def self.set_master_ps_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: einhorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  - Mike Perham
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-10 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -67,19 +67,33 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1'
69
69
  - !ruby/object:Gem::Dependency
70
- name: fiddle
70
+ name: logger
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '1.1'
75
+ version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: readline
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
- version: '1.1'
96
+ version: '0'
83
97
  description: Einhorn makes it easy to run multiple instances of an application server,
84
98
  all listening on the same port. You can also seamlessly restart your workers without
85
99
  dropping any requests. Einhorn requires minimal application-level support, making
@@ -143,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
157
  - !ruby/object:Gem::Version
144
158
  version: '0'
145
159
  requirements: []
146
- rubygems_version: 3.6.2
160
+ rubygems_version: 4.0.6
147
161
  specification_version: 4
148
162
  summary: 'Einhorn: the language-independent shared socket manager'
149
163
  test_files: []