Connection, returned to pool, should not be usable
- Langage dominant
- Python
- Étoiles
- 1.4k
- Forks
- 170
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
The following bug lived in our service for many month, once a few days producing strange error messages. I've even fixed a [real bug](https://github.com/aio-libs/aiopg/issues/216) in `aiopg` trying to figure out what is going on:
```
async with request.app["db"].acquire() as db:
await func1(db)
await func2(db)
```
Connection has been returned to pool, but is still being used outside of pool management logic. This can lead to various concurrency conflicts.
In my opinion, connections that are managed by the pool, should have some flag that either issues warning or raises exception that prevents using them this way. If community agrees, I can implement this and issue a pull-request.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.