cinder-volume disposes mysql pool every time it creates a volume
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Confirmed
|
Medium
|
Unassigned |
Bug Description
I create volumes with concurrency of 500, so I found huge number of TCP connections to mysql in *time_wait* status(on the server running cinder-volume). After going through the cinder-volume code, I found that every time I create a volume the connection pool is disposed. That's why so many *time_wait*.
Seems this bug was introduced in this [commit](https:/
"However, engine.dispose() shouldn't really be called anywhere else under normal circumstances because it closes out the whole connection pool, so this Base object needs to be something that is not generally created multiple times in-process."
They assumed that engine.dispose() will not be called multiple times in-process, but now it is. Every time we create a volume, engine.dispose() is called. Because of this line. https:/
I was going through the code of Pike version, the I checked master branch, seems master branch also has this issue.
Seems we can't assume engine.dispose() will only be called one time in process.Because there are many authors commit code. I am wondering if we can add a parameter(let's name it "dispose_db_engine" of default value False) for base.Base class https:/
Changed in cinder: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
According to your analysis, wouldn't we solve the issue if we just replaced the `message` instance attribute with a class attribute?