This PR introduces a watching mechanism for TCP connection in order to halt the query execution when the client disconnects.
T achieve this we use a system call expose by the syscall package names syscall.Recvfrom. A basic explanation using Go can be found on this StackOverflow answer and a more in-depth one here.
This feature was validated on macOS and Linux Alpine, but not on Windows.
Also, the implementation is designed over the HTTP/1.1 limitation that a connection handles only one HTTP request at a time. In order to support HTTP/2, we will need to change the context indexes handling inside middleware.ConnManager.
This PR introduces a watching mechanism for TCP connection in order to halt the query execution when the client disconnects.
T achieve this we use a system call expose by the
syscall
package namessyscall.Recvfrom
. A basic explanation using Go can be found on this StackOverflow answer and a more in-depth one here.This feature was validated on macOS and Linux Alpine, but not on Windows.
Also, the implementation is designed over the HTTP/1.1 limitation that a connection handles only one HTTP request at a time. In order to support HTTP/2, we will need to change the context indexes handling inside
middleware.ConnManager
.