Skip to content

Commit

Permalink
Fix NoResultFound error sometimes happening in the broker for old req…
Browse files Browse the repository at this point in the history
…uests
  • Loading branch information
francesconazzaro committed Jan 8, 2025
1 parent 5c3ce08 commit ed25dda
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cads_broker/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,15 @@ def sync_futures(self) -> None:

def on_future_done(self, future: distributed.Future) -> str:
with self.session_maker_write() as session:
request = db.get_request(future.key, session=session)
try:
request = db.get_request(future.key, session=session)
except db.NoResultFound:
logger.warning(
"request not found",
job_id=future.key,
dask_status=future.status,
)
return future.key
if request.status != "running":
return
if future.status == "finished":
Expand Down

0 comments on commit ed25dda

Please sign in to comment.