Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Cancelling dbt invocation does not cancel the query on Athena #774

Open
2 tasks done
Jrmyy opened this issue Dec 26, 2024 · 1 comment
Open
2 tasks done

[Bug] Cancelling dbt invocation does not cancel the query on Athena #774

Jrmyy opened this issue Dec 26, 2024 · 1 comment
Labels
bug Something isn't working triage

Comments

@Jrmyy
Copy link
Contributor

Jrmyy commented Dec 26, 2024

👋🏻 Hello dbt-athena community,

Is this a new bug in dbt-athena?

  • I believe this is a new bug in dbt-athena
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

When I try to cancel a dbt invocation, the invocation can be cancelled but the query is not cancelled in Athena. Therefore it can lead to concurrent requests when retrying.

Expected Behavior

When the dbt invocation cancel process is done, the query should be cancelled in Athena

Steps To Reproduce

  1. Run a model
  2. Cancel the invocation (for instance with CTRL + c)
  3. Check in Athena console if the query is still running or not

Relevant log output

No response

Environment

- OS: MacOS (the same problem in Docker image based on Debian)
- Python: 3.12.7
- dbt-core: 1.8.9
- dbt-athena: 1.8.4

Additional Context

No response

@Jrmyy Jrmyy added bug Something isn't working triage labels Dec 26, 2024
@Jrmyy
Copy link
Contributor Author

Jrmyy commented Dec 26, 2024

The adapter cancel behavior is defined here: https://github.com/dbt-labs/dbt-adapters/blob/b6152d6b7ad70ea5c97237b802916f6387d7f43a/dbt/adapters/base/impl.py#L1327

Then if we go to the SQLConnectionsManager, the cancel_open is defined here: https://github.com/dbt-labs/dbt-adapters/blob/b6152d6b7ad70ea5c97237b802916f6387d7f43a/dbt/adapters/sql/connections.py#L53

But in the AthenaConnectionsManager, we don't implement the cancel method:

def cancel(self, connection: Connection) -> None:
pass

The Connection object comes directly from pyathena: https://github.com/laughingman7743/PyAthena/blob/master/pyathena/connection.py#L42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant