Re: RegisterBackgroundWorker does not actually start a bg worker process in 9.4.4

From: John Lumby <johnlumby(at)hotmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: RegisterBackgroundWorker does not actually start a bg worker process in 9.4.4
Date: 2015-06-16 13:21:50
Message-ID: COL131-W29B608F04B5F67787E148CA3A70@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Michael,   thanks for checking,
I tried it again today and it is now working so I must have forgotten something.

John
----------------------------------------
> Date: Tue, 16 Jun 2015 08:33:09 +0900
> Subject: Re: [GENERAL] RegisterBackgroundWorker does not actually start a bg worker process in 9.4.4
> From: michael(dot)paquier(at)gmail(dot)com
> To: johnlumby(at)hotmail(dot)com
> CC: pgsql-general(at)postgresql(dot)org
>
> On Tue, Jun 16, 2015 at 3:58 AM, John Lumby <johnlumby(at)hotmail(dot)com> wrote:
>> I am new to bg_workers so this may be my user error,
>> but when I build and run the contrib/worker_spi
>> extension, I find that :
>>
>> . starting postgres with the extension named in shared_preload_libraries :
>> its _PG_init is invoked as expected but no process is started -
>> it is as though RegisterBackgroundWorker did nothing
>>
>> . creating the extension and then
>> psql ... "select worker_spi_launch(2);" :
>> I see
>> 28409 28288 ? 463508 00:05 00:00:00 0.0 postgres: bgworker: worker 2
>> as expected.
>>
>> Is there maybe some bug in postmaster's processing of
>> workers marked as start_at = BgWorkerStart_RecoveryFinished
>> in 9.4.4?
>
> Not that I know of. I am using static background workers even with 9.4
> clusters and they work as expected. Giving a try with worker_spi on
> 9.4, I see no problems as well:
> $ ps ux | grep bgworker
> michael 3906 0.0 0.1 2594780 7456 ?? Ss 8:21AM 0:00.02
> postgres: bgworker: worker 1
> michael 3905 0.0 0.1 2594780 6996 ?? Ss 8:21AM 0:00.02
> postgres: bgworker: worker 2
> $ psql -c 'show shared_preload_libraries'
> shared_preload_libraries
> --------------------------
> worker_spi
> (1 row)
>
> Regards,
> --
> Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Filipe Pina 2015-06-16 13:32:12 serialization failure why?
Previous Message mephysto 2015-06-16 13:02:32 Re: FW: PostgreSQL and iptables

Browse pgsql-hackers by date

  From Date Subject
Next Message kjsteuer 2015-06-16 14:47:04 Re: Function to get size of notification queue?
Previous Message Sawada Masahiko 2015-06-16 12:26:10 GIN function of pageinspect has inconsistency data type.