The driver supports timeouts, it's cool. But not in the way I expected. It does conn.SetReadDeadline/conn.SetWriteDeadline on every Read/Write call and it's bad, consider following situation:
I set timeout 2 seconds. I run a query. Query response size is 1024 bytes. Database server sends response with very high latency 128 bytes every second, so every Read call returns 128 bytes and doesn't raise timeout error (1 second < 2 seconds), but i will receive whole response in 8 seconds what doesn't fit into my timeout.
The driver should call conn.SetDeadline outside the Read loop as it is done in http protocol.
The driver supports timeouts, it's cool. But not in the way I expected. It does conn.SetReadDeadline/conn.SetWriteDeadline on every Read/Write call and it's bad, consider following situation: I set timeout 2 seconds. I run a query. Query response size is 1024 bytes. Database server sends response with very high latency 128 bytes every second, so every Read call returns 128 bytes and doesn't raise timeout error (1 second < 2 seconds), but i will receive whole response in 8 seconds what doesn't fit into my timeout. The driver should call conn.SetDeadline outside the Read loop as it is done in http protocol.