You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop creating a new engine as part of the process of running a health check.
Create an engine to be used across the application, and pass this into get_db_session when we go to get a single connection, instead of creating a new engine. (Note we are currently using the default pool_size and max_overflow parameters. This is something that may need to be configurable in the future). This is used for all our API endpoints.
Note that our celery processes intentionally create their own separate engines for managing connections for running privacy requests.
Steps to Reproduce
Bring up services nox -s dev -- shell ui mongo postgres
(fides_test database is incorrectly being used right now, but monitor connections there psql -h localhost -p 5432 -U postgres -d fides_test -c "SELECT sum(numbackends) FROM pg_stat_database"
Observe as periodic health checks are made in the console: 2022-09-30 01:50:36.458 [INFO] (main:log_request:262): Request received | {'method': 'GET', 'status_code': 200, 'handler_time': '363.21500000000003ms', 'path': '/health'}
Watch the number of connections increase linearly over time
sum
-----
22
Expected behavior
A description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Version:
OS:
Python Version:
Docker Version:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Bug Description
The health check endpoints are opening up too many connections against the application database.
This was previously addressed in fidesops ethyca/fidesops#1107 by:
Note that our celery processes intentionally create their own separate engines for managing connections for running privacy requests.
Steps to Reproduce
nox -s dev -- shell ui mongo postgres
fides_test
database is incorrectly being used right now, but monitor connections therepsql -h localhost -p 5432 -U postgres -d fides_test -c "SELECT sum(numbackends) FROM pg_stat_database"
2022-09-30 01:50:36.458 [INFO] (main:log_request:262): Request received | {'method': 'GET', 'status_code': 200, 'handler_time': '363.21500000000003ms', 'path': '/health'}
Expected behavior
A description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: