Compatibility: preserve root cause on connection timeouts with PG16 parameters

Aperta
#641 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
postgresql, python
Ambito
databases

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
385
Fork
393
Merge medio
4g 22h
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OCA/rest-framework

Tutte le issue di OCA/rest-framework

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.