@@ -161,7 +161,7 @@ def _set_envs():
161
161
finally :
162
162
_unset_envs ()
163
163
is_shutdown .set ()
164
- logger .debug (f 'process terminated' )
164
+ logger .debug ('process terminated' )
165
165
166
166
167
167
def run_stateful (args : 'argparse.Namespace' ,
@@ -181,6 +181,7 @@ def run_stateful(args: 'argparse.Namespace',
181
181
is_ready = multiprocessing .Event ()
182
182
is_shutdown = multiprocessing .Event ()
183
183
is_started = multiprocessing .Event ()
184
+ is_signal_handlers_installed = multiprocessing .Event ()
184
185
raft_worker = multiprocessing .Process (
185
186
target = run_raft ,
186
187
kwargs = {
@@ -192,10 +193,12 @@ def run_stateful(args: 'argparse.Namespace',
192
193
)
193
194
cargs = copy .deepcopy (args )
194
195
196
+ from jina .constants import RAFT_TO_EXECUTOR_PORT
197
+
195
198
if isinstance (cargs .port , int ):
196
- cargs .port += 1
199
+ cargs .port += RAFT_TO_EXECUTOR_PORT
197
200
elif isinstance (cargs .port , list ):
198
- cargs .port = [port + 1 for port in cargs .port ]
201
+ cargs .port = [port + RAFT_TO_EXECUTOR_PORT for port in cargs .port ]
199
202
worker = multiprocessing .Process (
200
203
target = run ,
201
204
kwargs = {
@@ -205,6 +208,7 @@ def run_stateful(args: 'argparse.Namespace',
205
208
'is_started' : is_started ,
206
209
'is_shutdown' : is_shutdown ,
207
210
'is_ready' : is_ready ,
211
+ 'is_signal_handlers_installed' : is_signal_handlers_installed ,
208
212
'runtime_cls' : runtime_cls ,
209
213
'jaml_classes' : JAML .registered_classes (),
210
214
},
0 commit comments