Replies: 2 comments 4 replies
-
No, we don't currently have a client query timeout. What you can do is to set a server timeout by using I honestly don't know what an unresponsive server is. Is this a real use case? With postgres? If we implemented a client timeout that unilaterally decides to interrupt the query, we should close the connection anyway, because we wouldn't be able to exit the ACTIVE state and, arguably, if the server is considered non responsive, there is not much point to send it another query. |
Beta Was this translation helpful? Give feedback.
-
@dvarrazzo Thanks for your response. We are using Amazon Aurora Postgres. Although database outages are rare, it is possible that the database availability zone may suddenly fail or a network misconfiguration could cause a database instance to become unavailable. In the case of these spontaneous failures I believe the server may be unresponsive. In our test suite we are using a module called toxiproxy to simulate an unresponsive server and are running into the issue where queries executed against that server hang indefinitely. In this scenario Yep, that's what the pgjdbc driver does if the socket timeout is enabled and has been reached - it closes the connection and throws an exception indicating that there was a socket timeout. |
Beta Was this translation helpful? Give feedback.
-
Hi, is there a way to set a driver-side query execution timeout? I noticed that the Postgres JDBC driver (pgjdbc) supports setting a driver-side socket/network timeout but as far as I can tell the psycopg driver does not. This is a problem for us because if the server becomes unresponsive, any queries being executed will hang indefinitely. Is there a suggested solution for this problem?
Beta Was this translation helpful? Give feedback.
All reactions