~vorlon/britney/+git/britney2-ubuntu:futz-with-email-frequency

Last commit made on 2017-07-07
Get this branch:
git clone -b futz-with-email-frequency https://git.launchpad.net/~vorlon/britney/+git/britney2-ubuntu
Only Steve Langasek can upload to this branch. If you are Steve Langasek please log in for upload directions.

Branch merges

Branch information

Name:
futz-with-email-frequency
Repository:
lp:~vorlon/britney/+git/britney2-ubuntu

Recent commits

132ffaf... by Steve Langasek

Refine the logic for recording the nominal sent age of the mail

In the previous iteration, if we were ever down/frozen/disabled long enough
to miss sending two mails in a row, we would see unintended "catch-up"
behavior where each subsequent run of britney would send a mail until the
right total number of mails had been sent. Don't do this; instead, catch us
up in one go to the most recent mail that should have been sent, avoiding
bunching of notifications.

This changes one of the tests also to match.

d5040af... by Steve Langasek

Fix up handling of email cache

We were checkpointing after each email was sent to ensure that an aborted
p-m run didn't result in double emails; however, because the new cache only
contains records for packages we've seen so far during this run (to avoid
the cache growing without bounds over time), that means an aborted p-m run
*still* throws away records for all packages still waiting to be processed.

To fix this, we:
 - only checkpoint records of writing emails during this in-progress run to
   a temp file
 - check for this temp file on britney startup, and if present, merge the
   results into the current state
 - move this temp file into the final cache location only at the end of the
   britney run

Along the way, fix up a bug introduced in the previous commit that would have
us only saving state for those packages for which we sent email during the
current run, which would have quite bad effects.

f680bb3... by Steve Langasek

add a couple more tests to show how the email frequency varies with valid/invalid candidates

6459977... by Steve Langasek

Make it possible to test the email frequency for a package that is sometimes a valid candidate and sometimes not

27ef44e... by Steve Langasek

Rework the email frequency calculation to account for gaps in runs

The previous code had some issues with respect to how we decided whether to
send an email. The age used for calculating when the next mail should be
sent was saved as a float rather than an integer; since p-m runs never
happen exactly an integer number of days after upload, this results in a
cumulative error in the timing of the emails, that is further exacerbated if
a particular run is significantly delayed or if p-m infrastructure is down
for a period of time.

So instead, we now calculate the age at which the most recent email /should
have been sent/, and store that in our cache instead of the precise age.

There is still a bit of surprising behavior here due to the fact that we use
two different 'max_age' values for valid vs. invalid candidate packages: a
single package can, over the course of its stay in -proposed, move from
being an invalid candidate to being a valid candidate /and back again/
without ever migrating. Such a package will switch back and forth between
two sets of calculations based on different starting offsets, causing the
ages at which the emails are sent to vary in a non-obvious fashion.
However, this will still obey the general principle of "email reminders of
decreasing frequency", so I think this is acceptable given that it is still
an overall improvement in predictability.

LP: #1671468

64d9bdd... by Steve Langasek

Adjust the email tests to the intervals we expect

9c76c76... by Robert Bruce Park

Tweak recurring email frequency.

41ac7a8... by Steve Langasek

Drop transitional code

16cca9c... by Robert Bruce Park

Change SourcePPAPolicy from a blacklist to a whitelist.

858775a... by Iain Lane

email: Make REJECTED_TEMPORARILY packages be not emailed for

These are rejections that we expect to clear out on their own or convert
to REJECTED_PERMANENTLY, at which point we will email.

https://bugs.launchpad.net/britney/+bug/1671468