July 26, 2019
4:52 a.m.
I am developing the processing of bounce messages as my GSoC project.
Currently the Bounce Functions
are being developed in this pr on GitLab.
There is one bool
attribute called bounce_you_are_disabled_warnings_interval
in the Mailing List
model.
It means
The number of days between each disabled notification.
Implementing this has a problem
- Say in the case of
process_bounces
function which processes theBounceEvents
function it is easy it just takes one by one the events from the database and processes them. - In the case of
Send_Warnings
function if the same approach was followed, meaning it would take one by one theAddress
instances, check tuples in thebounce_info
attribute ( see the pr for this ) and see whether to send a warning mail or not to can be a slow method. - Let's suppose the
Addresses
list is very long, then anAddress
instance in the very bottom of the list whose subscription has been disabled and some warning emails send, now waits to receive another mail as the interval is more thanbounce_you_are_disabled_warnings_interval
. - If the function is enumerating from the top then in order to take action first it has to reach this
Address
instance but the interval is already crossed. This can cause slow performance as thewarning mail
will be sent way late than it actually should have been sent. - Also if I am implementing 2 functions
process_bounces
andsend_warnings
what if both of them attempted at the sameAddress
instance? - Basically
implementation on sending warning mails
andimplementation to increase bounce_score
are separate things and they can cause problems if they processed the same instance.
Pointers on above will be helpful. Am I missing something above?