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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 934c5957de987807cb9a28cf740ee002cfa1c64d54c82b21acb16c464bfd8da0
4
- data.tar.gz: aef6141bd22834eb0f9fb837d374ec69b5681cb31bddc0fa1afda5cd82c3ec38
3
+ metadata.gz: 2daf0f4af407a699df75677a6cdfdaa798b6c870acd77ee75bdaced9c3944eb7
4
+ data.tar.gz: 40d6299f178209b2207966ceea322f1b36efef63f897a54f0a815fb28a2af71d
5
5
  SHA512:
6
- metadata.gz: eb93190b271548e433d9dcc9ce2d7b4f8358a4bd96079b24c1417bc43e86567840733265df4931d79beacd1ba31dbe23bd1e29c1d205982e036dc29861d68c2a
7
- data.tar.gz: '09f3589a04c3bbea01c619216066e7bbb9ac2e4414cd8345713315aa416cbe2600d537bec860034423bb4566881c5febc4efb33bfd28a376953c078aeee524fb'
6
+ metadata.gz: 95bd026a937bbf8ab666a9c89832e7c32d7b60c5a88ef91f61d08c6e6bf7595268e73c4eb03f09e972edd328f424304a17eb354d99e2caa7e14182f13bb76dd8
7
+ data.tar.gz: 0f6a91d444ae252cc232bd1151804c706a43415388a23e65b8861cd53dc5ac3a490f557d14b6aebcda03d12371c5220e2f30859b2300a3124b03781650c8ec7f
@@ -4,8 +4,10 @@ rvm:
4
4
  - 2.1.10
5
5
  - 2.2.9
6
6
  - 2.3.8
7
- - 2.4.5
8
- - 2.5.3
7
+ - 2.4.9
8
+ - 2.5.7
9
+ - 2.6.5
10
+ - 2.7.0
9
11
  - ruby-head
10
12
 
11
13
  branches:
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ 2020-11-02 version 2.2.2:
2
+
3
+ * Fix incomplete Windows support in spawn based multi worker
4
+
1
5
  2020-01-24 version 2.2.1:
2
6
 
3
7
  * Fix IPv6 dual-stack mode issue for UDP
@@ -120,10 +120,19 @@ module ServerEngine
120
120
  end
121
121
 
122
122
  def send_reload
123
- @pmon.send_signal(@reload_signal) if @pmon
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, @command_sender_pipe = IO.pipe
185
- @command_sender_pipe.sync = true
186
- @command_sender_pipe.binmode
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
- now = Time.now
370
- @next_kill_time ||= now
371
- @graceful_kill_start_time ||= now
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
- now = Time.now
376
- @next_kill_time ||= now
377
- @immediate_kill_start_time ||= now
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)
@@ -1,3 +1,3 @@
1
1
  module ServerEngine
2
- VERSION = "2.2.1"
2
+ VERSION = "2.2.2"
3
3
  end
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.1
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-01-24 00:00:00.000000000 Z
11
+ date: 2020-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sigdump