Connection remains open if InternalError happened during connect()
Abierto
- Lenguaje dominante
- Python
- Estrellas
- 1.4k
- Forks
- 170
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Imagine following situation:
```python
if conn.closed:
try:
conn = yield from aiopg.connect(dsn)
except psycopg2.InternalError as e:
print("reconnect InternalError ", str(e), type(e))
except psycopg2.Error as e:
print("reconnect error ", str(e), type(e))
```
When connect() raises InternalError (in my case that happens during hstore select request) conn is still points to old connection, but new connection remains open and after some time will emit ResourceWarning about deleting connection object with open _conn.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.