Hydra broken pipe

Hello. Thank you for building an amazing auth tool set. I am using hydra v1.4.6 on kubernetes. I know the database library changed to pgx and also followed the discussion closely on why broken pipe errors happen. This is so bad sometimes, you have to refresh so many times to (I think) exhaust the broken pipes which are (I think) pg connection pools that are dead. With my setup. Hydra is located at oauth.myapp.com. For a code grant, This means going from app.myapp.com to oauth.myapp.com which then fails with a broken pipe error and redirects to identity.myapp.com/auth/error which is the error endpoint and going back and physically changing the URL to app.myapp.com to retry the code grant and doing this three times until the old broken pipes are exhausted. Starting from identity.myapp.com with a login challenge also means pressing the login button three times until you reach a new set of pg connections. As a developer who knows the underlying issue it is okay but for users, it is not a great experience.

Is there a way to get around this? After reading the discussions, I wasn’t sure if switching the db library was supposed to provide a fix. But even after the switch to 1.4.6 with the new db library, this is still not working.

I’d suggest setting stuff like max_conns which typically fixes this issue. Docs: https://www.ory.sh/docs/ecosystem/deployment#postgresql