Skip to content

Commit ed70797

Browse files
Joan FontanalsJoanFM
andauthored
refactor: fix run stateful in docker (#6116)
Signed-off-by: Joan Martinez <[email protected]> Co-authored-by: Joan Martinez <[email protected]>
1 parent 7aab7e6 commit ed70797

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

jina/serve/executors/run.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def _set_envs():
161161
finally:
162162
_unset_envs()
163163
is_shutdown.set()
164-
logger.debug(f'process terminated')
164+
logger.debug('process terminated')
165165

166166

167167
def run_stateful(args: 'argparse.Namespace',
@@ -181,6 +181,7 @@ def run_stateful(args: 'argparse.Namespace',
181181
is_ready = multiprocessing.Event()
182182
is_shutdown = multiprocessing.Event()
183183
is_started = multiprocessing.Event()
184+
is_signal_handlers_installed = multiprocessing.Event()
184185
raft_worker = multiprocessing.Process(
185186
target=run_raft,
186187
kwargs={
@@ -192,10 +193,12 @@ def run_stateful(args: 'argparse.Namespace',
192193
)
193194
cargs = copy.deepcopy(args)
194195

196+
from jina.constants import RAFT_TO_EXECUTOR_PORT
197+
195198
if isinstance(cargs.port, int):
196-
cargs.port += 1
199+
cargs.port += RAFT_TO_EXECUTOR_PORT
197200
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]
199202
worker = multiprocessing.Process(
200203
target=run,
201204
kwargs={
@@ -205,6 +208,7 @@ def run_stateful(args: 'argparse.Namespace',
205208
'is_started': is_started,
206209
'is_shutdown': is_shutdown,
207210
'is_ready': is_ready,
211+
'is_signal_handlers_installed': is_signal_handlers_installed,
208212
'runtime_cls': runtime_cls,
209213
'jaml_classes': JAML.registered_classes(),
210214
},

0 commit comments

Comments
 (0)