Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional mariadb connection issues #753

Open
jmcarson opened this issue Sep 18, 2024 · 1 comment
Open

Occasional mariadb connection issues #753

jmcarson opened this issue Sep 18, 2024 · 1 comment
Assignees

Comments

@jmcarson
Copy link
Collaborator

jmcarson commented Sep 18, 2024

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 jmcarson self-assigned this Sep 18, 2024
@jmcarson
Copy link
Collaborator Author

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:

  • decrease CONN_MAX_AGE to less than 60
  • implement CONN_HEALTH_CHECKS - added in django 4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant