Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Make trying to resend a collection mail a warning instead of an asser…
Browse files Browse the repository at this point in the history
…tion

Summary:
Tasks are expected to be re-run occasionally if they fail to ack for some reason,
so issuing a warning and terminating successfully seems more appropriate than asserting
something we don't expect to always be true.
We've seen this assertion fail ~1k times in the past couple weeks, and that may be indicative
of other issues, but we can track that with the warning.

Test Plan: None

Reviewers: kajic

Reviewed By: kajic

Subscribers: changesbot, wwu

Differential Revision: https://tails.corp.dropbox.com/D99573
  • Loading branch information
kylec1 committed Apr 1, 2015
1 parent 0e9236e commit 414ee85
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions changes/listeners/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ def send(self, msg, build):
'recipients': msg.recipients,
}
})
assert event, 'An email has already been sent for collection_id={} (build_id={}).'.format(
build.collection_id, build.id.hex)
# If we were unable to create the Event, we must've done so (and thus sent the mail) already.
if not event:
self.logger.warning('An email has already been sent for collection_id={} (build_id={}).'.format(
build.collection_id, build.id.hex))
return

mail.send(msg)

Expand Down

0 comments on commit 414ee85

Please sign in to comment.