Re: on_exit_reset fails to clear DSM-related exit actions - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: on_exit_reset fails to clear DSM-related exit actions
Date
Msg-id 20140310201803.GM4759@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: on_exit_reset fails to clear DSM-related exit actions  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas escribió:

> A related point that's been bugging me for a while, and has just
> struck me again, is that background workers for which
> BGWORKER_SHMEM_ACCESS is not passed probably ought to be detaching
> shared memory (and DSMs).  Currently, and since Alvaro originally
> added the facility, the death of a  non-BGWORKER_SHMEM_ACCESS backend
> is used in postmaster.c to decide whether to call HandleChildCrash().
> But such workers could still clobber shared memory arbitrarily; they
> haven't unmapped it.  Oddly, the code in postmaster.c is only cares
> about the flag when checking EXIT_STATUS_0()/EXIT_STATUS_1(), not when
> checking ReleasePostmasterChildSlot()...

Clearly there's not a lot of consistency on that.  I don't think I had
made up my mind completely about such details.  I do remember that
unmapping/detaching the shared memory segment didn't cross my mind; the
flag, as I recall, only controls (controlled) whether to attach to it
explicitely.  

IOW feel free to whack around.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: GSoC 2014 - mentors, students and admins
Next
From: Robert Berry
Date:
Subject: Re: calculating an aspect of shared buffer state from a background worker