Skip to content

Commit a5d8570

Browse files
Add update of the status before stopping the experiment (#271)
1 parent 3df9700 commit a5d8570

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

autosubmit_api/runners/local_runner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ async def stop(self, expid: str, force: bool = False):
186186
187187
:param expid: The experiment ID to stop.
188188
"""
189+
# Force update of the runner status in case the process is not running anymore but the status is still active in the DB.
190+
self.get_runner_status(expid)
189191
# Get the process from the DB
190192
active_procs = self.runners_repo.get_active_processes_by_expid(expid)
191193
if not active_procs:

autosubmit_api/runners/ssh_runner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ async def stop(self, expid: str, force: bool = False):
341341
"""
342342
Stop the remote Autosubmit experiment by killing the process.
343343
"""
344+
# Force update of the runner status in case the process is not running anymore but the status is still active in the DB.
345+
self.get_runner_status(expid)
344346
# Get the process from the DB
345347
active_procs = self.runners_repo.get_active_processes_by_expid(expid)
346348
if not active_procs:

0 commit comments

Comments
 (0)