python-gino / gino-starlette

An extension for GINO to support Starlette server.
https://python-gino.org
Other
78 stars 24 forks source link

DB connection for request is not released when there are more than one database #15

Open kigawas opened 4 years ago

kigawas commented 4 years ago

With use_connection_for_request=True and two DBs:

db1.init_app(app)
db2.init_app(app)

And in the fastapi router, query db1 and db2.

  1. Call the api
  2. Change file contents to make it reload
  3. Try exiting

Then you'll see the server gets stuck.

kigawas commented 4 years ago

I guess the problem is in _Middleware, when setting scope, one connection overrides another.