Skip to content

Commit

Permalink
only log incident tracebacks when retries breached
Browse files Browse the repository at this point in the history
  • Loading branch information
diegocepedaw committed Mar 23, 2020
1 parent 05c509c commit da309a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/iris/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1718,13 +1718,13 @@ def on_post(self, req, resp):
session.commit()
session.close()
except (InternalError, OperationalError) as e:
logger.exception('Failed inserting incident. (Try %s/%s)', retries, max_retries)
logger.error('Failed inserting incident due to exception %s. (Try %s/%s)', retries, max_retries)
if retries < max_retries:
sleep_jitter = random.randint(10, 30) / 100
sleep(sleep_jitter)
continue
else:
logger.error('Breached incident insertion retry quota. Bailing on incident for plan %s', plan_id)
logger.exception('Breached incident insertion retry quota. Bailing on incident for plan %s', plan_id)
raise HTTPInternalServerError('Failed creating incident')
else:
break
Expand Down

0 comments on commit da309a4

Please sign in to comment.