-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Describe the bug
Requests to hydra (running with at least postgres) can sometimes hit an "idle" (but closed) connection to the DB. In this scenario the caller gets back:
error_hint=write tcp SRC:37738->DST:5432: write: broken pipe
I've run into similar errors in other apps, and the issue is upstream in lib/pq as well (lib/pq#870).
I was able to work around this issue by setting max_conn_lifetime=10s in the DSN -- as it avoids the connections being held open but actually closed on the remote.
Reproducing the bug
This has been annoying to reproduce on-demand. I've noticed this when tokens go to get refreshed from the IDP -- specifically after a long time (8hrs in this case) such that the connection can close out.
Expected behavior
I would expect that L4 errors such as this would be transparently retried instead of bubbling all the way to the client.