mirror of https://github.com/zulip/zulip.git
bd82c6edf9
The libpq client library, used under the hood by psycopg2, supports passing a list of hosts; they are tried sequentially until one of them works[^1]. In cases where this is used, it is often the case that the other servers are read-only hot spare replicas. Since Zulip does not expect to be in a read-only transaction, we require that the server that we connect to be writable, by passing `target_session_attrs`[^2]. To limit how long we may block connecting to a potentially bad host before moving on, we set `connection_timeout` from null (meaning forever) to 2 (the lowest supported value)[^3], so we move on quickly in the case that the server is running but unable to handle new connections. [^1]: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-MULTIPLE-HOSTS [^2]: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-TARGET-SESSION-ATTRS [^3]: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT |
||
---|---|---|
.. | ||
jinja2 | ||
__init__.py | ||
backends.py | ||
computed_settings.py | ||
config.py | ||
configured_settings.py | ||
default_settings.py | ||
dev_settings.py | ||
dev_urls.py | ||
email_backends.py | ||
prod_settings.pyi | ||
prod_settings_template.py | ||
sentry.py | ||
settings.py | ||
settings_types.py | ||
template_loaders.py | ||
test_extra_settings.py | ||
test_settings.py | ||
urls.py | ||
wsgi.py |