Re: Proposals for making it easier to write correct bgworkers - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Proposals for making it easier to write correct bgworkers
Date
Msg-id 20200918223845.GC30016@momjian.us
Whole thread Raw
In response to Proposals for making it easier to write correct bgworkers  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
On Thu, Sep 10, 2020 at 11:02:07AM +0800, Craig Ringer wrote:
> Hi all
> 
> As I've gained experience working on background workers, it's become
> increasingly clear that they're a bit too different to normal backends for many
> nontrivial uses.
> 
> I thought I'd take a moment to note some of it here, along with some proposals
> for things we could potentially do to make it much easier to use bgworkers
> correctly especially when using them to run queries.
> 
> This is NOT A PATCH SET. It's a set of discussion proposals and it's also
> intended as a bit of a helper for people just getting started on bgworkers.
> There are a lot of subtle differences in the runtime environment a basic
> bgworker provides vs the runtime environment extension authors will be used to
> when writing fmgr-callable C functions.
> 
> (It looks like pg12 and pg13 have some improvements, so some of the issues I
> was going to mention with error cleanup paths and locking aren't relevant
> anymore.)
> 
> DIFFERENCES WHEN CODING FOR BGWORKERS

Can we put this information somewhere in our docs or source code as a
README?

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: recovering from "found xmin ... from before relfrozenxid ..."
Next
From: Bruce Momjian
Date:
Subject: Re: Proposal of new PostgreSQL Extension - PGSpiderExt