Skip site navigation (1) Skip section navigation (2)

Re: pg_listener entries deleted under heavy NOTIFY load only on Windows

From: "Marshall, Steve" <smarshall(at)wsi(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: pg_listener entries deleted under heavy NOTIFY load only on Windows
Date: 2009-01-28 17:34:49
Message-ID: 49809739.6060009@wsi.com (view raw or flat)
Thread:
Lists: pgsql-bugs
*** async.c.8.3.5	2009-01-28 12:25:11.966356419 -0500
--- async.c	2009-01-28 12:26:51.955740151 -0500
***************
*** 101,107 ****
  #include "utils/fmgroids.h"
  #include "utils/memutils.h"
  #include "utils/ps_status.h"
! 
  
  /*
   * State for pending LISTEN/UNLISTEN actions consists of an ordered list of
--- 101,107 ----
  #include "utils/fmgroids.h"
  #include "utils/memutils.h"
  #include "utils/ps_status.h"
! #include "storage/procarray.h"
  
  /*
   * State for pending LISTEN/UNLISTEN actions consists of an ordered list of
***************
*** 628,633 ****
--- 628,634 ----
  		}
  		else
  		{
+ 			int listenerExists = 1;
  			if (Trace_notify)
  				elog(DEBUG1, "AtCommit_Notify: notifying pid %d",
  					 listenerPID);
***************
*** 649,657 ****
  				 * we should just do it for any failure (certainly at least
  				 * for EPERM too...)
  				 */
! 				simple_heap_delete(lRel, &lTuple->t_self);
  			}
! 			else if (listener->notification == 0)
  			{
  				/* Rewrite the tuple with my PID in notification column */
  				rTuple = heap_modifytuple(lTuple, tdesc, value, nulls, repl);
--- 650,670 ----
  				 * we should just do it for any failure (certainly at least
  				 * for EPERM too...)
  				 */
! 				if (IsBackendPid(listenerPID))
! 				{
! 					elog(LOG, "kill(%d) SIGUSR2 failed, but process is running: %m",
! 						   listenerPID);	
! 				}
! 				else
! 				{
! 					elog(LOG, "kill(%d) SIGUSR2 failed, process is NOT running: %m",
! 						   listenerPID);	
! 					listenerExists = 0;
! 					simple_heap_delete(lRel, &lTuple->t_self);
! 				}
  			}
! 
! 			if (listenerExists && listener->notification == 0)
  			{
  				/* Rewrite the tuple with my PID in notification column */
  				rTuple = heap_modifytuple(lTuple, tdesc, value, nulls, repl);

Attachment: async.c.notify_patch
Description: text/plain (1.8 KB)
Attachment: unknown_filename
Description: text/html (4.9 KB)

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2009-01-28 17:44:20
Subject: Re: pg_listener entries deleted under heavy NOTIFY load only on Windows
Previous:From: Pavel StehuleDate: 2009-01-28 17:18:01
Subject: server crash when tsearch2 function is called from update trigger

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group