serverengine 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -2
- data/Changelog +4 -0
- data/lib/serverengine/multi_process_server.rb +10 -1
- data/lib/serverengine/multi_spawn_server.rb +0 -7
- data/lib/serverengine/process_manager.rb +28 -11
- data/lib/serverengine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2daf0f4af407a699df75677a6cdfdaa798b6c870acd77ee75bdaced9c3944eb7
|
4
|
+
data.tar.gz: 40d6299f178209b2207966ceea322f1b36efef63f897a54f0a815fb28a2af71d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95bd026a937bbf8ab666a9c89832e7c32d7b60c5a88ef91f61d08c6e6bf7595268e73c4eb03f09e972edd328f424304a17eb354d99e2caa7e14182f13bb76dd8
|
7
|
+
data.tar.gz: 0f6a91d444ae252cc232bd1151804c706a43415388a23e65b8861cd53dc5ac3a490f557d14b6aebcda03d12371c5220e2f30859b2300a3124b03781650c8ec7f
|
data/.travis.yml
CHANGED
data/Changelog
CHANGED
@@ -120,10 +120,19 @@ module ServerEngine
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def send_reload
|
123
|
-
|
123
|
+
return nil unless @pmon
|
124
|
+
if @pmon.command_sender_pipe
|
125
|
+
send_command("RELOAD\n")
|
126
|
+
else
|
127
|
+
@pmon.send_signal(@reload_signal)
|
128
|
+
end
|
124
129
|
nil
|
125
130
|
end
|
126
131
|
|
132
|
+
def send_command(command)
|
133
|
+
@pmon.send_command(command) if @pmon
|
134
|
+
end
|
135
|
+
|
127
136
|
def join
|
128
137
|
@pmon.join if @pmon
|
129
138
|
nil
|
@@ -46,13 +46,6 @@ module ServerEngine
|
|
46
46
|
@pm.command_sender = @command_sender
|
47
47
|
end
|
48
48
|
|
49
|
-
def stop(stop_graceful)
|
50
|
-
if @command_sender == "pipe"
|
51
|
-
@pm.command_sender_pipe.write(stop_graceful ? "GRACEFUL_STOP\n" : "IMMEDIATE_STOP\n")
|
52
|
-
end
|
53
|
-
super
|
54
|
-
end
|
55
|
-
|
56
49
|
def run
|
57
50
|
super
|
58
51
|
ensure
|
@@ -71,7 +71,6 @@ module ServerEngine
|
|
71
71
|
attr_reader :enable_heartbeat, :auto_heartbeat
|
72
72
|
|
73
73
|
attr_accessor :command_sender
|
74
|
-
attr_reader :command_sender_pipe
|
75
74
|
|
76
75
|
CONFIG_PARAMS = {
|
77
76
|
heartbeat_interval: 1,
|
@@ -180,10 +179,11 @@ module ServerEngine
|
|
180
179
|
end
|
181
180
|
end
|
182
181
|
|
182
|
+
command_sender_pipe = nil
|
183
183
|
if @command_sender == "pipe"
|
184
|
-
inpipe,
|
185
|
-
|
186
|
-
|
184
|
+
inpipe, command_sender_pipe = IO.pipe
|
185
|
+
command_sender_pipe.sync = true
|
186
|
+
command_sender_pipe.binmode
|
187
187
|
options[:in] = inpipe
|
188
188
|
end
|
189
189
|
env['SERVERENGINE_SOCKETMANAGER_INTERNAL_TOKEN'] = SocketManager::INTERNAL_TOKEN
|
@@ -193,6 +193,7 @@ module ServerEngine
|
|
193
193
|
end
|
194
194
|
|
195
195
|
m = Monitor.new(pid, monitor_options)
|
196
|
+
m.command_sender_pipe = command_sender_pipe
|
196
197
|
|
197
198
|
@monitors << m
|
198
199
|
|
@@ -307,9 +308,11 @@ module ServerEngine
|
|
307
308
|
@graceful_kill_start_time = nil
|
308
309
|
@immediate_kill_start_time = nil
|
309
310
|
@kill_count = 0
|
311
|
+
|
312
|
+
@command_sender_pipe = nil
|
310
313
|
end
|
311
314
|
|
312
|
-
attr_accessor :last_heartbeat_time
|
315
|
+
attr_accessor :last_heartbeat_time, :command_sender_pipe
|
313
316
|
attr_reader :pid
|
314
317
|
|
315
318
|
def heartbeat_delay
|
@@ -329,6 +332,10 @@ module ServerEngine
|
|
329
332
|
end
|
330
333
|
end
|
331
334
|
|
335
|
+
def send_command(command)
|
336
|
+
@command_sender_pipe.write(command) if @command_sender_pipe
|
337
|
+
end
|
338
|
+
|
332
339
|
def try_join
|
333
340
|
pid = @pid
|
334
341
|
return true unless pid
|
@@ -366,15 +373,25 @@ module ServerEngine
|
|
366
373
|
end
|
367
374
|
|
368
375
|
def start_graceful_stop!
|
369
|
-
|
370
|
-
|
371
|
-
|
376
|
+
if ServerEngine.windows?
|
377
|
+
# heartbeat isn't supported on Windows
|
378
|
+
send_command("GRACEFUL_STOP\n")
|
379
|
+
else
|
380
|
+
now = Time.now
|
381
|
+
@next_kill_time ||= now
|
382
|
+
@graceful_kill_start_time ||= now
|
383
|
+
end
|
372
384
|
end
|
373
385
|
|
374
386
|
def start_immediate_stop!
|
375
|
-
|
376
|
-
|
377
|
-
|
387
|
+
if ServerEngine.windows?
|
388
|
+
# heartbeat isn't supported on Windows
|
389
|
+
system("taskkill /f /pid #{@pid}")
|
390
|
+
else
|
391
|
+
now = Time.now
|
392
|
+
@next_kill_time ||= now
|
393
|
+
@immediate_kill_start_time ||= now
|
394
|
+
end
|
378
395
|
end
|
379
396
|
|
380
397
|
def tick(now=Time.now)
|
data/lib/serverengine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sigdump
|