On Fri, Jun 23, 2023 at 8:47 PM PG Bug reporting form
<noreply@postgresql.org> wrote:
> My questions: (as I could not find a corresponding bug in the pgsql-bugs)
> Is a similar issue allready known?
> Can anybody recommend a change (update, patch, configuration parameter)?
> What could I provide for further analysis (pg_stat_activity) ?
It sounds like something may be wrong, because it should respond to
cancellation promptly (unless perhaps the system is completely swamped
due to resource issues and not responding to anything but it didn't
sound like that from your description). Before and after you cancel
the query, what do the 'hanging' processes show in the wait_event
column of pg_stat_activity? Are they still consuming CPU after you
cancel? Can you get a backtrace of the running processes, with
something like gstack (it may help to install the 'debug symbol'
package for PostgreSQL). What does the query plan look like, ie
EXPLAIN SELECT ...?