Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Too many health check db connections #1102

Closed
pattisdr opened this issue Aug 17, 2022 · 0 comments · Fixed by #1107
Closed

Too many health check db connections #1102

pattisdr opened this issue Aug 17, 2022 · 0 comments · Fixed by #1107
Assignees
Labels
bug Something isn't working

Comments

@pattisdr
Copy link
Contributor

pattisdr commented Aug 17, 2022

Bug Description

The health check endpoint is creating new engines which are probably creating their own connection pools each time it is called. We should be sharing an engine https://github.com/ethyca/fidesops/blob/main/src/fidesops/ops/api/v1/endpoints/health_endpoints.py#L37

This opens up too many connections against the fidesops database very quickly.

h/t @RobertKeyser and @sanders41 for finding this.

Steps to Reproduce

Bring up the fidesops server and monitor your connections against the fidesops application database.

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.

@pattisdr pattisdr added the bug Something isn't working label Aug 17, 2022
@pattisdr pattisdr changed the title Too many health check connections Too many health check db connections Aug 17, 2022
sanders41 pushed a commit that referenced this issue Aug 17, 2022
* Don't create a new engine as part of running the health checks and share a single engine across the application, including for the health checks.  Currently we're using the default pool_size and max_overflow.

* Update changelog.

* Fix that health checks are still supposed to run, even if the database is disabled.

* Need to yield instead -  'generator' object has no attribute 'query'
sanders41 pushed a commit that referenced this issue Sep 22, 2022
* Don't create a new engine as part of running the health checks and share a single engine across the application, including for the health checks.  Currently we're using the default pool_size and max_overflow.

* Update changelog.

* Fix that health checks are still supposed to run, even if the database is disabled.

* Need to yield instead -  'generator' object has no attribute 'query'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant