Closed joellubi closed 1 week ago
Hi and thank you for raising this issue; especially with such a nice self contained reproduction! It indeed reproduces and when replacing putQuery
with something else like a SELECT...
, it works as expected. But not with PUT/GET.
We'll take a look.
Short update; indeed the processFileTransfer
does not seem to contain WithCancel
. We're working on a fix and I'll keep this thread posted.
we have a draft PR at https://github.com/snowflakedb/gosnowflake/pull/1108 for this, will keep this thread updated
change is merged and will be part of the upcoming next release
released with gosnowflake v.1.11.1
Context cancellation works for other queries executed using
conn.ExecContext()
, but is ignored for PUT/GET commands because it is not propagated any further than thesnowflakeConn.processFileTransfer()
method.What version of GO driver are you using? github.com/snowflakedb/gosnowflake v1.7.1
What operating system and processor architecture are you using? macOS 14.1.1 x86_64
What version of GO are you using? go version go1.21.5 darwin/amd64
Server version: 8.1.0
What did you do?
import ( "context" "database/sql" "log" "time"
)
func main() { cfg := &gosnowflake.Config{ // Redacted }
}
% go run . 2024/01/10 21:11:22 Starting PUT upload 2024/01/10 21:11:32 Canceled 2024/01/10 21:11:32 context canceled exit status 1
% go run . 2024/01/10 21:11:22 Starting PUT upload 2024/01/10 21:11:32 Canceled 2024/01/10 21:12:36 Completed PUT upload