

Both sides (client and database) think that the connection is still active but the network equipment has dropped the connection. When this happens is look exactly like what you describe. This doesn't cause any issues for web pages and APIs but database connections get clobbered. ISPs drop idle connections a lot so that they can handle the load of traffic and connections that flow through their equipment. They do this so that the network equipment can "forget" about these connections and focus on "active" connections. The problem come in when the operators of the network equipment decide that connections that have no data flowing are "stale" after some fixed amount of time. No problem and with the right set of network configurations these connections can be open and idle for days. One connection is made and many back and forth transmissions of data happen while the connection is open. However, database connections are different. These network actions are atomic from a network connection point of view. When you click on a link a new connection is established and also end quickly. Typical network connections are fairly quick - you ask for a web page and it is given to you. The cause is network switches and their configurations. In this case the queries were not being seen by the database or the connection to the database was being dropped mid execution. Since I've seen similar behavior before I'll write up a possible way this can happen. Put a unique comment in the query to help determine if it is actually the query in question. You can check this by reviewing svl_statementtext to see if the query is even being seen.

I suspect that the queries in question are not even being launched on the database. I'm sorry if I wasn't able to explain it clearly, I tried searching for simmilar issues but couldn't. But today, I tried manipulating this cluster with R using RJDBC, and the same thing happens: I can run queries, until I stop, and then when I try running something else it never stops, until I disconnect and connect again. I tought this was a dBeaver issue, as we have a Meabase connected to this same cluster without any issues. Until I stop using for some minutes, and then it's happens all over again. The only way i can get it to work is by cancelling, disconnecting from the redshift, connecting again and then it executes correctly. I am using dBeaver Community 21.2.2 to interact with the connection, and it stays "Executing query" forever. However, if I spend some time without running anything (like, 5 minutes), when I try running another query or command, ir never finishes. I am experiencing an issue where after I connect to the database, I can run queries without any issue. I am working on a new Amazon Redshift database that I recently started.
