zulip/zerver/worker
Alex Vandiver 5f5ad2f0b1 queue_processors: Defer initial email connection creation.
We previously created the connection to the outgoing email server when
the EmailSendingWorker was first created.  Since creating the
connection can fail (e.g. because of firewalls or typos in the
hostname), this can cause the `QueueProcessingWorker` creation to
raise an exception.  In multi-threaded mode, exceptions in the worker
threads which are _not_ during the handling of a specific event
percolate out to `log_and_exit_if_exception` and trigger the
termination of the entire process -- stopping all worker threads from
making forward progress.

Contain the blast radius of misconfigured email servers by deferring
the opening of the connection until it is first needed.  This will not
cause any overall performance change, since it only affects the
latency of the very first email after startup.

(cherry picked from commit c618c42729)
2024-01-15 12:02:53 -08:00
..
__init__.py
queue_processors.py queue_processors: Defer initial email connection creation. 2024-01-15 12:02:53 -08:00