UW-GAC / primed-django

PRIMED Consortium Django application website
MIT License
0 stars 0 forks source link

Occasional mariadb connection issues #753

Open jmcarson opened 1 month ago

jmcarson commented 1 month ago

OperationalError at /accounts/drupal_oauth_provider/login/ (2006, '')

This is typically caused by the mariadb connection in django no longer being active when used.

Possibly caused by our recent upgrade. Look into connection time mismatch between mariadb and django and consider implementing health checks:

https://docs.djangoproject.com/en/4.2/ref/databases/#persistent-database-connections

jmcarson commented 1 month ago

Investigation. We have the following in production.py and no override in .env DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60) The wait timeout for our mariadb is much higher: SHOW VARIABLES LIKE 'wait_timeout'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | wait_timeout | 28800 |

This setting may have an impact: | thread_pool_idle_timeout | 60 |

This may have changed during our recent mariadb upgrade. Options are to: