In the past months we had some new insights:
- the problem was not with the actual emails, but with the generation of the underlying notificiations
- generating many notifications in quick succession leads to Sidekiq restarting with
Sidekiq is consuming too much memory - Sidekiq restarting leads to the current batch of notifications that is being generated for a post, being aborted, resulting in an incomplete set of notifications.
EDIT raising UNICORN_SIDEKIQ_MAX_RSS has prevented this issue from happening again in the past 9 days.