In case of a TCP disconnect (i.e., server-side graceful TCP shutdown), query result stream should return error instead of just hanging indefinitely.
Before this change, it would hang due to ClickhouseTransport::poll_next returning Pending upon reaching EOF on socket stream.
In order to properly handle TCP disconnect:
1) ClickhouseTransport should detect this condition and return None to signal that there are no more packets
2) BlockStream should handle end of packets:
1) Return error from Stream::next()
2) Prevent reuse of connection in pool
In case of a TCP disconnect (i.e., server-side graceful TCP shutdown), query result stream should return error instead of just hanging indefinitely.
Before this change, it would hang due to
ClickhouseTransport::poll_next
returningPending
upon reaching EOF on socket stream.In order to properly handle TCP disconnect:
1)
ClickhouseTransport
should detect this condition and returnNone
to signal that there are no more packets 2)BlockStream
should handle end of packets:1) Return error from
Stream::next()
2) Prevent reuse of connection in pool