Re: shared tempfile was not removed on statement_timeout

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, "Bossart, Nathan" <bossartn@amazon.com>
Date: 2020-07-27T08:00:46Z
Lists: pgsql-hackers
On Tue, Jul 21, 2020 at 4:33 PM Justin Pryzby <pryzby@telsasoft.com> wrote:
>  /*
>   * clean up a spool structure and its substructures.
>   */
>  static void
>  _bt_spooldestroy(BTSpool *btspool)
>  {
> +       void *fileset = tuplesort_shared_fileset(btspool->sortstate);
> +       if (fileset)
> +               SharedFileSetDeleteAll(fileset);
>         tuplesort_end(btspool->sortstate);
>         pfree(btspool);
>  }

Why can't tuplesort_end do it?



Commits

  1. Hold interrupts while running dsm_detach() callbacks.