public inbox for [email protected]  
help / color / mirror / Atom feed
From: Heikki Linnakangas <[email protected]>
To: Robert Haas <[email protected]>
To: Craig Ringer <[email protected]>
Cc: pgsql-docs <[email protected]>
Subject: Re: bgworker / SPI docs patches
Date: Thu, 30 Jul 2015 10:47:03 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmoatWF2R+ApiqviK76r3N=Wj+M_kcS8owpH+jKA9Mzh=ow@mail.gmail.com>
References: <CAMsr+YFq3AyOdiQc_EcXF49QEnU3VWpMK9LTzJ+hy-FuBbb6FQ@mail.gmail.com>
	<CA+TgmoYe3-XHazbJf6wc7Bwjtoo-_UGkh=d6p1FJh0mCRrmEMg@mail.gmail.com>
	<CA+TgmoatWF2R+ApiqviK76r3N=Wj+M_kcS8owpH+jKA9Mzh=ow@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-docs>

On 07/29/2015 09:42 PM, Robert Haas wrote:
> +   <warning>
> +    <para>
> +     Use of this field is deprecated. It should be set to
> +     <literal>NULL</literal> then <structfield>bgw_library_name</structfield>
> +     and <structfield>bgw_function_name</structfield> should be used instead.
> +    </para>
>
> I don't think bgw_main is exactly deprecated.  It's fine to use it if
> the function is in the core code; it just can't be safely used for
> functions in dynamically loaded shared libraries.  Maybe that's close
> enough to "deprecated" that we should just call it deprecated, but I'm
> slightly reluctant to use that word.

Hmm. worker_spi module uses bgw_main. Is that bad? Given that work_spi 
is supposedly an example or template that you copy-paste from when 
writing your own bgworker, we should make sure it follows the best 
practice. Also, I note that worker_spi doesn't memset(0) its 
BackgroundWorker struct, so any uninitialized fields will contain 
garbage. Including bgw_library_name and bgw_function_name. That seems bad.

> I've committed some bits of this that seem useful and controversial
> with rather extensive wordsmithing; let me know if it doesn't look
> good.

I've marked this as committed in the commitfest. If we're waiting for a 
followup patch for the remaining bits, please change it back to Waiting 
on Author, or post the followup patch to the next commitfest if it can't 
be done quickly.

- Heikki


-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: bgworker / SPI docs patches
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox