Skip to content

Actually cancel statements#29

Merged
serramatutu merged 1 commit into
v1.17.0+dbtfrom
serramatutu/cancel
May 19, 2026
Merged

Actually cancel statements#29
serramatutu merged 1 commit into
v1.17.0+dbtfrom
serramatutu/cancel

Conversation

@serramatutu
Copy link
Copy Markdown

@serramatutu serramatutu commented May 19, 2026

Changes

Use errors.Is(err, context.Canceled) instead of err == context.Canceled

Why

It looks like the Go standard library rewrites all errors as a url.Error, including context.Canceled and context.DeadlineExceeded. httpClient.do wraps the returned error into a url.Error

This was making the upstream check for context.Canceled or context.DeadlineExceeded fail since it uses strict equality, so the gosnowflake logic that issues the cancellation request never gets executed.

My commit replaces this with errors.Is instead.

Testing

I ran Fusion with driver debug logs enabled. After my change, you can see the client actually call cancelQuery.

image

You can see the statement now shows as actually canceled in the Snowflake dashboard

image

@serramatutu serramatutu changed the base branch from master to v1.17.0+dbt May 19, 2026 12:36
@serramatutu serramatutu force-pushed the serramatutu/cancel branch from e099145 to 0a6a4da Compare May 19, 2026 12:51
Copy link
Copy Markdown
Collaborator

@felipecrv felipecrv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you report this upstream also?

@serramatutu serramatutu merged commit bb1a3f7 into v1.17.0+dbt May 19, 2026
1 check failed
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants