zulip/zproject
Alex Vandiver bd82c6edf9 settings: Support multiple database replicas in REMOTE_POSTGRES_HOST.
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
2024-04-04 16:48:58 -07:00
..
jinja2 jinja2: Make sure that 500 pages have support_email set. 2023-04-12 16:41:07 -07:00
__init__.py
backends.py auth: Avoid deprecated django.contrib.auth.views.logout_then_login. 2024-04-04 16:27:58 -07:00
computed_settings.py settings: Support multiple database replicas in REMOTE_POSTGRES_HOST. 2024-04-04 16:48:58 -07:00
config.py config: Use logic from zulip_tools, to support bools. 2024-03-15 15:34:12 -07:00
configured_settings.py settings: Print about custom settings from runtornado. 2023-12-05 12:33:34 -08:00
default_settings.py worker: Split out worker sampling rate, and add Sentry transactions. 2024-03-21 12:46:13 -07:00
dev_settings.py settings: Simplify testing push bouncer. 2023-12-10 17:36:25 -08:00
dev_urls.py dev_urls: Make requests to /docs redirect to the index. 2024-03-21 11:27:14 -07:00
email_backends.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
prod_settings.pyi lint: Replace pycodestyle and pyflakes with ruff. 2022-11-03 12:10:15 -07:00
prod_settings_template.py s3: Add a setting for S3 addressing style. 2024-01-05 11:12:18 -08:00
sentry.py worker: Split out worker sampling rate, and add Sentry transactions. 2024-03-21 12:46:13 -07:00
settings.py ruff: Fix M001 Unused `noqa` directive. 2022-11-03 12:10:15 -07:00
settings_types.py saml: Rework SP-initiated logout config to support IdP-level config. 2023-05-23 13:01:15 -07:00
template_loaders.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
test_extra_settings.py Revert "zproject: Prevent having exactly 17/18 middlewares, for Python 3.11 bug." 2024-02-05 19:57:21 -05:00
test_settings.py settings: Refactor how TEST_SUITE is configured. 2023-12-04 09:50:14 -08:00
urls.py compose_validate: Remove autosubscribe feature. 2024-03-28 09:06:48 -07:00
wsgi.py requirements: Upgrade Python requirements. 2024-01-29 10:41:54 -08:00