Compatibility: preserve root cause on connection timeouts with PG16 parameters

Abierto
#641 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
18/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Tranquilo
Stack tecnológico
postgresql, python
Área
databases

Línea de trabajo

The issue names no file, function or test. Start by reproducing the problem with a multi-host PostgreSQL DSN that uses target_session_attrs or sslnegotiation, and find where the connection fallback loop catches and re-raises errors. Done would mean the original timeout is chained or preserved in the traceback, which the maintainers would need to agree on first, since the expected behaviour is not yet specified.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hi everyone,

While working with PostgreSQL 16 multi-host DSNs that utilize newer connection parameters like target_session_attrs or sslnegotiation, we noticed that fallback connection attempts can sometimes obscure the original root cause during network timeouts. This can occasionally make diagnosing connectivity issues in clustered environments a bit trickier than necessary.

Environment
  • Python 3.12
  • Linux / Ubuntu 22.04
  • OCA/rest-framework (current main)
  • psycopg / psycopg2 (PostgreSQL 16 connection handling)
Steps to Reproduce
  1. Configure a multi-host PostgreSQL DSN in Odoo utilizing target_session_attrs=read-write or sslnegotiation=direct.
  2. Simulate a network timeout or unreachable primary node where fallback logic is triggered.
  3. Observe the resulting exception traceback.
Expected Behavior

The underlying root cause and original timeout exception should be preserved or clearly chained in the traceback to facilitate faster debugging.

Actual Behavior

The original network timeout context can sometimes be swallowed during the fallback iteration across connection attempts.

Happy to submit a quick PR for this if the maintainers are open to it!


Reported by Usman Ghias · Senior Systems & Backend Architect · Open for Select Senior Remote & Consulting Roles

Lenguaje dominante
Python
Estrellas
385
Forks
393
Merge medio
4 d 22 h
PR fusionados (30 d)
21

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OCA/rest-framework

Todos los issues de OCA/rest-framework

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.