You are here: Home / LBN / Up2date / Core Linux / BastionLinux 36 / python3-django-dbconn-retry-0.1.7-1.lbn36.noarch

python3-django-dbconn-retry-0.1.7-1.lbn36.noarch

Package Attributes
RPM  python3-django-dbconn-retry-0.1.7-1.lbn36.noarch.rpm Architecture  noarch Size  20640 Created  2025/05/19 12:49:45 UTC
Package Specification
Summary Patch Django to retry a database connection first before failing.
Group Unspecified
License ZPL
Home Page https://pypi.org/project/django-dbconn-retry
Description

Django Database Connection Autoreconnect

This library monkeypatches django.db.backends.base.BaseDatabaseWrapper so that when a database operation fails because the underlying TCP connection was already closed, it first tried to reconnect, instead of immediately raising an OperationException.

Why is this useful? I use HAProxy as a load-balancer in front of my PostgreSQL databases all the time, sometimes in addition to pgbouncer. Even though you can mostly prevent surprises by enabling TCP keep-alive packets through tcpka, clitcpka and srvtcpka, I still encounter situations where the underlying TCP connection has been closed through the load-balancer. Most often this results in django.db.utils.OperationalError: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. This library patches Django such that it try to reconnect once before failing. Another application of this is when using Hashicorp Vault, where

Requires
rpmlib(PayloadFilesHavePrefix)  
rpmlib(PayloadIsZstd)  
rpmlib(CompressedFileNames)  
rpmlib(PartialHardlinkSets)  
rpmlib(FileDigests)  
Provides
python-django-dbconn-retry
python3-django-dbconn-retry
python3.10-django-dbconn-retry
python3.10dist(django-dbconn-retry)
python3dist(django-dbconn-retry)
Obsoletes
python-django-dbconn-retry

Document Actions