blue_green_process 0.1.4 → 0.1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +1 -1
- data/lib/blue_green_process/master_process.rb +5 -4
- data/lib/blue_green_process/version.rb +1 -1
- data/lib/blue_green_process.rb +10 -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: 864e404c1e622e26d8689695a3791b4cf6c84709127617a5d778b550cb03527c
|
4
|
+
data.tar.gz: 002bba05528b78c7be7184c74bbbf0b94418c12d01d3c93cda5883043b6c376b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 511d89c74a5a24331cb3d4cc3e72aacf92d8eaed3cc2abcfc4e8964949fa2760fb311d3dd265f2ef185a35c53af70042fa2106b0c6297548793a4565fbc2de9b
|
7
|
+
data.tar.gz: ab4c37316936239229d153bc4c54747cb184319bd04438d16c81100c0dfc8346c27273727b57112cc9f8f764b91ca4daa28fea8f00d848f93774d216fcde9cbb
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
## [0.1.4] - 2022-12-
|
1
|
+
## [0.1.4.2] - 2022-12-25
|
2
|
+
* プロセス終了時にDRb.stop_serviceを呼ぶのをやめました
|
3
|
+
|
4
|
+
## [0.1.4.1] - 2022-12-13
|
5
|
+
* プロセス終了時にDRb.stop_serviceを呼ぶようにしました
|
6
|
+
|
7
|
+
## [0.1.4] - 2022-12-12
|
2
8
|
* BlueGreenProcess.terminate_workers_immediately を呼び出すことで、シグナル経由で終了できるようになりました
|
3
9
|
|
4
10
|
## [0.1.3] - 2022-9-5
|
data/Gemfile.lock
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "English"
|
3
4
|
module BlueGreenProcess
|
4
5
|
class ErrorWrapper < StandardError
|
5
6
|
attr_accessor :error_class, :message
|
@@ -70,9 +71,7 @@ module BlueGreenProcess
|
|
70
71
|
data: BlueGreenProcess::SharedVariable.data }.to_json)
|
71
72
|
::GC.start unless BlueGreenProcess::SharedVariable.extend_run_on_this_process
|
72
73
|
when BlueGreenProcess::PROCESS_COMMAND_WORK
|
73
|
-
if process_status == BlueGreenProcess::PROCESS_STATUS_INACTIVE
|
74
|
-
warn "Should not be able to run in this status"
|
75
|
-
end
|
74
|
+
warn "Should not be able to run in this status" if process_status == BlueGreenProcess::PROCESS_STATUS_INACTIVE
|
76
75
|
|
77
76
|
begin
|
78
77
|
worker_instance.work(*label)
|
@@ -159,8 +158,10 @@ module BlueGreenProcess
|
|
159
158
|
while (readable_io = IO.select([self_read]))
|
160
159
|
signal = readable_io.first[0].gets.strip
|
161
160
|
case signal
|
162
|
-
when "
|
161
|
+
when "TERM"
|
163
162
|
raise Interrupt
|
163
|
+
when "INT"
|
164
|
+
BlueGreenProcess.logger.warn "[BLUE_GREEN_PROCESS][#{$PROCESS_ID}] INTシグナルは無視します"
|
164
165
|
end
|
165
166
|
end
|
166
167
|
rescue Interrupt
|
data/lib/blue_green_process.rb
CHANGED
@@ -57,6 +57,8 @@ module BlueGreenProcess
|
|
57
57
|
|
58
58
|
# @return [void]
|
59
59
|
def self.terminate_workers_immediately
|
60
|
+
BlueGreenProcess.logger.warn "[BLUE_GREEN_PROCESS][#{$PROCESS_ID}] TERMシグナルを送信します"
|
61
|
+
|
60
62
|
worker_pids = nil
|
61
63
|
begin
|
62
64
|
worker_pids = File.read(PID_PATH).split(",").map(&:to_i)
|
@@ -68,7 +70,14 @@ module BlueGreenProcess
|
|
68
70
|
worker_pids.each do |worker_pid|
|
69
71
|
Process.kill "TERM", worker_pid
|
70
72
|
rescue Errno::ESRCH => e
|
71
|
-
warn("
|
73
|
+
BlueGreenProcess.logger.warn("[BLUE_GREEN_PROCESS][#{$PROCESS_ID}] workerプロセス(#{worker_pid})の終了に失敗しました。#{e.message}")
|
74
|
+
end
|
75
|
+
|
76
|
+
begin
|
77
|
+
Process.wait
|
78
|
+
rescue Errno::ECHILD => e
|
79
|
+
BlueGreenProcess.logger.warn("[BLUE_GREEN_PROCESS][#{$PROCESS_ID}] Process.wait(#{e.message})に失敗しました")
|
72
80
|
end
|
81
|
+
BlueGreenProcess.logger.warn "[BLUE_GREEN_PROCESS][#{$PROCESS_ID}] TERMシグナルを送信しました"
|
73
82
|
end
|
74
83
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blue_green_process
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.4
|
4
|
+
version: 0.1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jiikko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A library that solves GC bottlenecks with multi-process.
|
14
14
|
email:
|