Hi,
I was wondering if anyone has any great ideas for how to deal with cancellation of long running queries started from a Prefect task. In my case I’m dealing with PostgreSQL and while psycopg2 will try to gently stop a query when you close a connection, in many cases the reason we are cancelling a flow/task is because that query has been running for too long and is unlikely to finish naturally in an acceptable timeframe.
Instead of having to manually kill the query with
pg_terminate_backend
it would be nice if the task getting cancelled would be able to call
pg_terminate_backend
.