ConnectionResetError: Cannot write to closing transport
Currently, the application is using a single global connection to the PostgreSQL database. In the local environment this does not cause issues, since only one request is handled at a time and the connection remains active. However, in AWS EKS, where multiple requests run in parallel and RDS may close idle connections, that global connection becomes invalid. As a result, all subsequent requests try to reuse it, leading to errors such as:
ConnectionResetError: Cannot write to closing transport