Skip to content

Commit

Permalink
[batch] Do not log user errors as exceptions (#14253)
Browse files Browse the repository at this point in the history
The current lack of this guard means we log exceptions when users submit
jobs with images that don't exist or when users cancel their jobs
(`ContainerDeletedError`). We do this check elsewhere but looks like
this line slipped through.
  • Loading branch information
daniel-goldstein committed Feb 6, 2024
1 parent 671deef commit f1542f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions batch/batch/worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1877,8 +1877,9 @@ async def on_completion():
raise
except ContainerDeletedError as exc:
log.info(f'Container {container} was deleted while running.', exc)
except Exception:
log.exception(f'While running container: {container}')
except Exception as e:
if not user_error(e):
log.exception(f'While running container: {container}')

async def run(self):
async with self.worker.cpu_sem(self.cpu_in_mcpu):
Expand Down

0 comments on commit f1542f3

Please sign in to comment.