Skip to content

Commit

Permalink
fix(run-manager): graceful shutdown of job-controller (reanahub#559)
Browse files Browse the repository at this point in the history
Use exec to execute job-controller, so that the server can receive
signals such as `SIGTERM`.

Closes reanahub/reana-job-controller#347
  • Loading branch information
mdonadoni committed Jan 29, 2024
1 parent 176ef50 commit f54d951
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reana_workflow_controller/workflow_run_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def _create_job_spec(

def _create_job_controller_startup_cmd(self, user=None):
"""Create job controller startup cmd."""
base_cmd = "flask run -h 0.0.0.0;"
base_cmd = "exec flask run -h 0.0.0.0;"
if user:
add_group_cmd = "groupadd -f -g {} {};".format(
WORKFLOW_RUNTIME_USER_GID, WORKFLOW_RUNTIME_USER_GID
Expand All @@ -710,7 +710,7 @@ def _create_job_controller_startup_cmd(self, user=None):
WORKFLOW_RUNTIME_USER_UID,
self.workflow.workspace_path,
)
run_app_cmd = 'su {} /bin/bash -c "{}"'.format(user, base_cmd)
run_app_cmd = 'exec su {} /bin/bash -c "{}"'.format(user, base_cmd)
full_cmd = add_group_cmd + add_user_cmd + chown_workspace_cmd + run_app_cmd
return [full_cmd]
else:
Expand Down

0 comments on commit f54d951

Please sign in to comment.