blue_green_process 0.1.4.2 → 0.1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +5 -6
- data/README.md +0 -23
- data/lib/blue_green_process/master_process.rb +3 -0
- data/lib/blue_green_process/version.rb +1 -1
- data/lib/blue_green_process/worker_process.rb +1 -1
- data/lib/blue_green_process.rb +6 -8
- 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: de6dcd9d5d0d1f000d05cecc5a9e71c9aac40785ab9b662ed3f3e355520583b8
|
4
|
+
data.tar.gz: 869f46eade0cbc23f0ad787f37c32dc88e00a8887bdb4d8d16761a00725f10d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f91ae14371f167c9d1b4ca8480a4b8a02c3487daca3a19e0ce299a99d46c56fe47381a6ed30c61399415995865b7f4118aa7ce823ca1bdd60f27b64fc6e6b7a
|
7
|
+
data.tar.gz: b3f7831d0b007d35ba40958b7b14e6faac6f2ad67f0d03bacc1f515f37474f0889c7514bc01dd88c30b74be590dcf20597f0395982dee00119f1ef6e603c04c6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## [0.1.4.3] - 2024-1-8
|
2
|
+
- 処理を停止するときにpidを書いたファイルを削除するようになりました
|
3
|
+
|
1
4
|
## [0.1.4.2] - 2022-12-25
|
2
5
|
* プロセス終了時にDRb.stop_serviceを呼ぶのをやめました
|
3
6
|
|
@@ -5,7 +8,7 @@
|
|
5
8
|
* プロセス終了時にDRb.stop_serviceを呼ぶようにしました
|
6
9
|
|
7
10
|
## [0.1.4] - 2022-12-12
|
8
|
-
* BlueGreenProcess.terminate_workers_immediately
|
11
|
+
* BlueGreenProcess.terminate_workers_immediately を呼び出すことで、masterプロセスからシグナル経由でworkerプロセスを終了できるようになりました
|
9
12
|
|
10
13
|
## [0.1.3] - 2022-9-5
|
11
14
|
* 単一プロセスでの実行を延長するとGC.startを実行しなくなりました
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
blue_green_process (0.1.4.
|
4
|
+
blue_green_process (0.1.4.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -12,11 +12,13 @@ GEM
|
|
12
12
|
json (2.6.2)
|
13
13
|
method_source (1.0.0)
|
14
14
|
parallel (1.22.1)
|
15
|
-
parser (3.
|
15
|
+
parser (3.3.0.2)
|
16
16
|
ast (~> 2.4.1)
|
17
|
+
racc
|
17
18
|
pry (0.14.1)
|
18
19
|
coderay (~> 1.1)
|
19
20
|
method_source (~> 1.0)
|
21
|
+
racc (1.7.3)
|
20
22
|
rainbow (3.1.1)
|
21
23
|
rake (13.0.6)
|
22
24
|
regexp_parser (2.5.0)
|
@@ -59,7 +61,4 @@ DEPENDENCIES
|
|
59
61
|
pry
|
60
62
|
rake
|
61
63
|
rspec
|
62
|
-
rubocop
|
63
|
-
|
64
|
-
BUNDLED WITH
|
65
|
-
2.3.15
|
64
|
+
rubocop
|
data/README.md
CHANGED
@@ -2,29 +2,6 @@
|
|
2
2
|
|
3
3
|
A library that solves GC bottlenecks with multi-process.
|
4
4
|
|
5
|
-
```mermaid
|
6
|
-
sequenceDiagram
|
7
|
-
autonumber
|
8
|
-
loop
|
9
|
-
Master->>+Blue: be active
|
10
|
-
Blue->>-Master: response
|
11
|
-
Master->>+Blue: work
|
12
|
-
Blue->>-Master: response
|
13
|
-
Master->>+Blue: be inactive
|
14
|
-
Blue->>-Master: response
|
15
|
-
Blue-->>Blue: GC.start
|
16
|
-
Master->>+Green: be active
|
17
|
-
Green->>-Master: response
|
18
|
-
Master->>+Green: work
|
19
|
-
Green->>-Master: response
|
20
|
-
Master->>+Green: be inactive
|
21
|
-
Green->>-Master: response
|
22
|
-
Green->>Green: GC.start
|
23
|
-
end
|
24
|
-
|
25
|
-
```
|
26
|
-
|
27
|
-
|
28
5
|
## Installation
|
29
6
|
|
30
7
|
Install the gem and add to the application's Gemfile by executing:
|
@@ -49,7 +49,7 @@ module BlueGreenProcess
|
|
49
49
|
def wait_response
|
50
50
|
return unless (text = read)
|
51
51
|
|
52
|
-
response = JSON.parse(text.strip)
|
52
|
+
response = JSON.parse(text.strip.scrub)
|
53
53
|
BlueGreenProcess::SharedVariable.instance.restore(response["data"])
|
54
54
|
case response["c"]
|
55
55
|
when BlueGreenProcess::RESPONSE_OK
|
data/lib/blue_green_process.rb
CHANGED
@@ -63,7 +63,7 @@ module BlueGreenProcess
|
|
63
63
|
begin
|
64
64
|
worker_pids = File.read(PID_PATH).split(",").map(&:to_i)
|
65
65
|
rescue Errno::ENOENT
|
66
|
-
warn("#{PID_PATH}にファイルがありませんでした")
|
66
|
+
BlueGreenProcess.logger.warn("[BLUE_GREEN_PROCESS] #{PID_PATH}にファイルがありませんでした")
|
67
67
|
return
|
68
68
|
end
|
69
69
|
|
@@ -72,12 +72,10 @@ module BlueGreenProcess
|
|
72
72
|
rescue Errno::ESRCH => e
|
73
73
|
BlueGreenProcess.logger.warn("[BLUE_GREEN_PROCESS][#{$PROCESS_ID}] workerプロセス(#{worker_pid})の終了に失敗しました。#{e.message}")
|
74
74
|
end
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
end
|
81
|
-
BlueGreenProcess.logger.warn "[BLUE_GREEN_PROCESS][#{$PROCESS_ID}] TERMシグナルを送信しました"
|
75
|
+
BlueGreenProcess.logger.warn "[BLUE_GREEN_PROCESS][#{$PROCESS_ID}] workerプロセスへTERMシグナルを送信しました"
|
76
|
+
Process.waitall
|
77
|
+
BlueGreenProcess.logger.warn "[BLUE_GREEN_PROCESS][#{$PROCESS_ID}] workerプロセスが終了しました"
|
78
|
+
ensure
|
79
|
+
FileUtils.rm_rf(BlueGreenProcess::PID_PATH)
|
82
80
|
end
|
83
81
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jiikko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A library that solves GC bottlenecks with multi-process.
|
14
14
|
email:
|