summaryrefslogtreecommitdiff
path: root/issues/sql-too-many-connections.gmi
blob: f8db41b91f2e8e1e744af90fb1cbcdc2d465cf15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# MySQLdb._exceptions.OperationalError: (1040, 'Too many connections')

## Tags

* assigned: bonfacem, fredm, aruni
* type: bug
* keywords: mysql, database

## Tasks

* [ ] Figure out root cause
* [ ] Send patch

## Description

See the strack trace present in this page:

=> https://ci.genenetwork.org/jobs/genenetwork2/214


### Debug notes

The function decorated with `@app.before_requests` is called before every request, even ones retrieving static files like CSS and JS files. This executes the `sqlalchemy.create_engine(...)' statement many times for each page.

I started by checking whether the request is to a *static* or *js* endpoint, and if it is, we do not bother trying to create the engine in that case.

This does not resolve the issue per-se, but it does reduce a lot of the noise when logging.