bayserver-core 2.3.1 → 2.3.2
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 +4 -4
- data/lib/baykit/bayserver/agent/grand_agent.rb +8 -7
- data/lib/baykit/bayserver/agent/grand_agent_monitor.rb +35 -22
- data/lib/baykit/bayserver/docker/base/inbound_ship.rb +2 -0
- data/lib/baykit/bayserver/docker/base/port_base.rb +1 -1
- data/lib/baykit/bayserver/taxi/taxi_runner.rb +1 -0
- data/lib/baykit/bayserver/tours/tour_res.rb +1 -1
- data/lib/baykit/bayserver/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: ef1870c148ef4f045575bdd31e28b5e13808013fa159e0642a627471e0b80962
|
4
|
+
data.tar.gz: 0247c5d8b92f4c9f1cf95b20ae02687202d524c6edd82158711bce98fa5e8e6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3460ae4f7b5d50945fb20e5f6072838fe7277ccf6d6b9f0cd9d8e51e4ecd3c87a729121cc1d502edb8ddb120841e99377a63ba62324515a74de06d27fe769b6
|
7
|
+
data.tar.gz: 22d1f706b151704256cf55526e8b4bc6d29a04c2ab543c9803cb32316719239140997390d7b88b500e1d248cc8281821e68666ba68f2abdddd247880a2dbc698
|
@@ -196,7 +196,7 @@ module Baykit
|
|
196
196
|
end # while
|
197
197
|
|
198
198
|
rescue => e
|
199
|
-
BayLog.
|
199
|
+
BayLog.fatal_e(e)
|
200
200
|
ensure
|
201
201
|
BayLog.info("%s end", self)
|
202
202
|
shutdown()
|
@@ -211,13 +211,15 @@ module Baykit
|
|
211
211
|
end
|
212
212
|
|
213
213
|
@command_receiver.end()
|
214
|
+
@non_blocking_handler.close_all()
|
215
|
+
|
214
216
|
GrandAgent.listeners.each do |lis|
|
215
217
|
lis.remove(self)
|
216
218
|
end
|
217
219
|
|
218
220
|
GrandAgent.agents.delete(@agent_id)
|
219
|
-
clean()
|
220
221
|
|
222
|
+
@agent_id = -1
|
221
223
|
if BayServer.harbor.multi_core
|
222
224
|
exit(1)
|
223
225
|
end
|
@@ -225,6 +227,10 @@ module Baykit
|
|
225
227
|
|
226
228
|
def abort_agent()
|
227
229
|
BayLog.info("%s abort", self)
|
230
|
+
|
231
|
+
if BayServer.harbor.multi_core
|
232
|
+
exit(1)
|
233
|
+
end
|
228
234
|
end
|
229
235
|
|
230
236
|
def req_shutdown()
|
@@ -280,11 +286,6 @@ module Baykit
|
|
280
286
|
val = IOUtil.read_int32(pipe_fd)
|
281
287
|
end
|
282
288
|
|
283
|
-
def clean()
|
284
|
-
@non_blocking_handler.close_all()
|
285
|
-
@agent_id = -1
|
286
|
-
end
|
287
|
-
|
288
289
|
######################################################
|
289
290
|
# class methods
|
290
291
|
######################################################
|
@@ -25,11 +25,13 @@ module Baykit
|
|
25
25
|
attr :agent_id
|
26
26
|
attr :anchorable
|
27
27
|
attr :communication_channel
|
28
|
+
attr :child_pid
|
28
29
|
|
29
|
-
def initialize(agt_id, anchorable, com_channel)
|
30
|
+
def initialize(agt_id, anchorable, com_channel, child_pid)
|
30
31
|
@agent_id = agt_id
|
31
32
|
@anchorable = anchorable
|
32
33
|
@communication_channel = com_channel
|
34
|
+
@child_pid = child_pid
|
33
35
|
end
|
34
36
|
|
35
37
|
def to_s()
|
@@ -42,7 +44,7 @@ module Baykit
|
|
42
44
|
if res == nil || res == GrandAgent::CMD_CLOSE
|
43
45
|
BayLog.debug("%s read Close", self)
|
44
46
|
close()
|
45
|
-
|
47
|
+
agent_aborted()
|
46
48
|
else
|
47
49
|
BayLog.debug("%s read OK: %d", self, res)
|
48
50
|
end
|
@@ -81,6 +83,33 @@ module Baykit
|
|
81
83
|
@communication_channel.close()
|
82
84
|
end
|
83
85
|
|
86
|
+
def agent_aborted()
|
87
|
+
BayLog.info(BayMessage.get(:MSG_GRAND_AGENT_SHUTDOWN, @agent_id))
|
88
|
+
|
89
|
+
if @child_pid != nil
|
90
|
+
begin
|
91
|
+
Process.kill("TERM", @child_pid)
|
92
|
+
rescue => e
|
93
|
+
BayLog.debug_e(e, "Error on killing process")
|
94
|
+
end
|
95
|
+
Process.wait(@child_pid)
|
96
|
+
end
|
97
|
+
GrandAgentMonitor.monitors.delete(@agent_id)
|
98
|
+
|
99
|
+
if not GrandAgentMonitor.finale
|
100
|
+
if GrandAgentMonitor.monitors.length < GrandAgentMonitor.num_agents
|
101
|
+
begin
|
102
|
+
if !BayServer.harbor.multi_core
|
103
|
+
GrandAgent.add(-1, @anchorable)
|
104
|
+
end
|
105
|
+
GrandAgentMonitor.add(@anchorable)
|
106
|
+
rescue => e
|
107
|
+
BayLog.error_e(e)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
84
113
|
########################################
|
85
114
|
# Class methods
|
86
115
|
########################################
|
@@ -151,32 +180,16 @@ module Baykit
|
|
151
180
|
agt.run()
|
152
181
|
end
|
153
182
|
|
183
|
+
child = nil
|
184
|
+
|
154
185
|
end
|
155
186
|
|
156
187
|
@monitors[agt_id] =
|
157
188
|
GrandAgentMonitor.new(
|
158
189
|
agt_id,
|
159
190
|
anchoroable,
|
160
|
-
client_socket
|
161
|
-
|
162
|
-
|
163
|
-
def self.agent_aborted(agt_id, anchorable)
|
164
|
-
BayLog.info(BayMessage.get(:MSG_GRAND_AGENT_SHUTDOWN, agt_id))
|
165
|
-
|
166
|
-
@monitors.delete(agt_id)
|
167
|
-
|
168
|
-
if not @finale
|
169
|
-
if @monitors.length < @num_agents
|
170
|
-
begin
|
171
|
-
if !BayServer.harbor.multi_core
|
172
|
-
GrandAgent.add(-1, anchorable)
|
173
|
-
end
|
174
|
-
add(anchorable)
|
175
|
-
rescue => e
|
176
|
-
BayLog.error_e(e)
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
191
|
+
client_socket,
|
192
|
+
child)
|
180
193
|
end
|
181
194
|
|
182
195
|
def self.reload_cert_all()
|
@@ -203,7 +203,7 @@ module Baykit
|
|
203
203
|
end
|
204
204
|
|
205
205
|
def return_protocol_handler(agt, proto_hnd)
|
206
|
-
BayLog.debug("%s Return protocol handler
|
206
|
+
BayLog.debug("%s Return protocol handler", proto_hnd)
|
207
207
|
PortBase.get_protocol_handler_store(proto_hnd.protocol, agt).Return(proto_hnd)
|
208
208
|
end
|
209
209
|
|
@@ -338,7 +338,7 @@ module Baykit
|
|
338
338
|
begin
|
339
339
|
@tour.ship.send_error(@tour.ship_id, @tour, status, msg, err)
|
340
340
|
rescue IOError => e
|
341
|
-
BayLog.
|
341
|
+
BayLog.debug_e(e, "%s Error on sending error", self)
|
342
342
|
@tour.change_state(Tour::TOUR_ID_NOCHECK, Tour::TourState::ABORTED)
|
343
343
|
end
|
344
344
|
@header_sent = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bayserver-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michisuke-P
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: BayServer is one of the high-speed web servers. It operates as a single-threaded,
|
14
14
|
asynchronous server, which makes it exceptionally fast. It also supports multi-core
|