mirror of https://github.com/zulip/zulip.git
9afde790c6
Previously the outgoing emails were sent over several SMTP connections through the EmailSendingWorker; establishing a new connection each time adds notable overhead. Redefine EmailSendingWorker worker to be a LoopQueueProcessingWorker, which allows it to handle batches of events. At the same time, persist the connection across email sending, if possible. The connection is initialized in the constructor of the worker in order to keep the same connection throughout the whole process. The concrete implementation of the consume_batch function is simply processing each email one at a time until they have all been sent. In order to reuse the previously implemented decorator to retry sending failures a new method that meets the decorator's required arguments is declared inside the EmailSendingWorker class. This allows to retry the sending process of a particular email inside the batch if the caught exception leaves this process retriable. A second retry mechanism is used inside the initialize_connection function to redo the opening of the connection until it works or until three attempts failed. For this purpose the backoff module has been added to the dependencies and a test has been added to ensure that this retry mechanism works well. The connection is closed when the stop method is called. Fixes: #17672. |
||
---|---|---|
.. | ||
README.md | ||
common.in | ||
dev.in | ||
dev.txt | ||
docs.in | ||
docs.txt | ||
mypy.in | ||
mypy.txt | ||
pip.in | ||
pip.txt | ||
prod.in | ||
prod.txt | ||
thumbor-dev.in | ||
thumbor-dev.txt | ||
thumbor.in | ||
thumbor.txt |
README.md
The dependency graph of the requirements is as follows:
dev +-> prod +-> common
+
|
v
mypy,docs,pip
Of the files, only dev, prod, and mypy have been used in the install scripts directly. The rest are implicit dependencies.
Steps to update a lock file, e.g. to update ipython from 5.3.0 to latest version:
0. Remove entry for ipython==5.3.0
in dev.txt.
- Run
./tools/update-locked-requirements
, which will generate new entries, pinned to the latest version. - Increase
PROVISION_VERSION
inversion.py
. - Run
./tools/provision
to install the new deps and test them. - Commit your changes.