Skip to content

Destroy lost connection objects acquired from mysql.connect() #31

Closed
@Totktonada

Description

@Totktonada

When a connection is acquired from a pool, lost and collected by Lua GC, its underlying connection will be closed from a GC callback. A connection that is created directly w/o a pool using mysql.connect() has no such GC callback, so its underlying connection will not be properly closed if a user does not call <connection object>:close() manually.

A fiber may store a connection in its local variable. If this fiber does not handle abnormal exit properly and, say, does not close the connection when is hit by fiber.cancel(), the underlying connection will leak.

We should test than the underlying connection is closed in the case.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingprio5

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions