-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Hi, I noticed there are few attempts to add cancel to client, pool, etc.
As of now I believe there's no full-proof solution yet.
However, just wondering if it is possible that I can add my own hack to get this working?
There are some long-running queries which if the user aborts (like request.on('close')
),
I can cancel the long running query to prevent the server from becoming blocking and also improve server's CPU utilisation.
My initial idea is that can I run SELECT pg_backend_pid()
before running the actual query and the pg_cancel_backend
when request is closed. But since this is in pool, each query will be using the available connection which may lead to a wrong pid.
Thanks in advance.
Jamby93 and Thrimbda
Metadata
Metadata
Assignees
Labels
No labels