Re: [PATCHES] [pgsql-hackers-win32] postmaster.pid

2004-08-26 Thread Dave Page
 

> -Original Message-
> From: Tom Lane [mailto:[EMAIL PROTECTED] 
> Sent: 26 August 2004 16:24
> To: Dave Page
> Cc: Andrew Dunstan; Magnus Hagander; 
> [EMAIL PROTECTED]; PostgreSQL-patches
> Subject: Re: [PATCHES] [pgsql-hackers-win32] postmaster.pid 
> 
> "Dave Page" <[EMAIL PROTECTED]> writes:
> >> ISTM we should not ever queue any event for signal 0.
> 
> > That was my original intention, however Magnus thought it 
> best just to 
> > let it be queued and subsequently ignored by the backend - thinking 
> > about it 15 minutes later I can't for the life of me think 
> why that's 
> > any better...
> 
> Are there any error cases that we would miss detecting if it 
> didn't go that far?

None that I can think of. If we managed to open the pipe and get the
zero back, then we've proved the process is there and is postgres.

Regards Dave.

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PATCHES] [pgsql-hackers-win32] postmaster.pid

2004-08-26 Thread Tom Lane
"Dave Page" <[EMAIL PROTECTED]> writes:
>> ISTM we should not ever queue any event for signal 0.

> That was my original intention, however Magnus thought it best just to
> let it be queued and subsequently ignored by the backend - thinking
> about it 15 minutes later I can't for the life of me think why that's
> any better...

Are there any error cases that we would miss detecting if it didn't go
that far?

regards, tom lane

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [PATCHES] [pgsql-hackers-win32] postmaster.pid

2004-08-26 Thread Magnus Hagander
Shouldn't be necessary. We can do it, but it makes no real difference
:-) It just ends up queued, but since there is no signal #0, it will
never get dispatched.

But it certainly wouldn't break things to do it either :-)

//Magnus


> Should we (if only for the sake of completeness) make the 
> converse one-byte change in port/win32/signal.c?
> 
> It says:
> 
> void
> pg_queue_signal(int signum)
> {
> if (signum >= PG_SIGNAL_COUNT || signum < 0)
> return;
>  ...
> 
> ISTM we should not ever queue any event for signal 0.
> 
> cheers
> 
> andrew
> 
> 
> Dave Page wrote:
> 
> > 
> >
> >  
> >
> >>-Original Message-
> >>From: Magnus Hagander [mailto:[EMAIL PROTECTED]
> >>Sent: 25 August 2004 14:59
> >>To: Tom Lane
> >>Cc: Dave Page; [EMAIL PROTECTED]
> >>Subject: RE: [pgsql-hackers-win32] postmaster.pid
> >>
> >>Ok, if you say so :-) I had the general impression we 
> wanted that. But 
> >>then let's go with the 
> >>send-signal-0-down-the-pipe-and-ignore-it-in-the-backend. :-)
> >>
> >>
> >
> >Here's the massive 1 byte change required to do just that :-)
> >
> >Regards, Dave.
> >
> >
> >===
> >RCS file: /projects/cvsroot/pgsql-server/src/port/kill.c,v
> >retrieving revision 1.2
> >diff -u -r1.2 kill.c
> >--- kill.c   24 Jun 2004 18:53:48 -  1.2
> >+++ kill.c   26 Aug 2004 14:07:49 -
> >@@ -26,7 +26,7 @@
> > BYTEsigRet = 0;
> > DWORD   bytes;
> > 
> >-if (sig >= PG_SIGNAL_COUNT || sig <= 0)
> >+if (sig >= PG_SIGNAL_COUNT || sig < 0)
> > {
> > errno = EINVAL;
> > return -1;
> >
> >---(end of 
> >broadcast)---
> >TIP 2: you can get off all lists at once with the unregister command
> >(send "unregister YourEmailAddressHere" to 
> >[EMAIL PROTECTED])
> >
> >  
> >
> 
> 

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] [pgsql-hackers-win32] postmaster.pid

2004-08-26 Thread Dave Page
 

> -Original Message-
> From: Andrew Dunstan [mailto:[EMAIL PROTECTED] 
> Sent: 26 August 2004 15:43
> To: Dave Page
> Cc: Magnus Hagander; Tom Lane; 
> [EMAIL PROTECTED]; PostgreSQL-patches
> Subject: Re: [PATCHES] [pgsql-hackers-win32] postmaster.pid
> 
> 
> Should we (if only for the sake of completeness) make the 
> converse one-byte change in port/win32/signal.c?
> 
> It says:
> 
> void
> pg_queue_signal(int signum)
> {
> if (signum >= PG_SIGNAL_COUNT || signum < 0)
> return;
>  ...
> 
> ISTM we should not ever queue any event for signal 0.

That was my original intention, however Magnus thought it best just to
let it be queued and subsequently ignored by the backend - thinking
about it 15 minutes later I can't for the life of me think why that's
any better...

Regards, Dave.

Index: backend/port/win32/signal.c
===
RCS file:
/projects/cvsroot/pgsql-server/src/backend/port/win32/signal.c,v
retrieving revision 1.4
diff -u -r1.4 signal.c
--- backend/port/win32/signal.c 24 Jun 2004 21:02:42 -  1.4
+++ backend/port/win32/signal.c 26 Aug 2004 14:58:25 -
@@ -162,7 +162,7 @@
 void
 pg_queue_signal(int signum)
 {
-   if (signum >= PG_SIGNAL_COUNT || signum < 0)
+   if (signum >= PG_SIGNAL_COUNT || signum <= 0)
return;
 
EnterCriticalSection(&pg_signal_crit_sec);
Index: port/kill.c
===
RCS file: /projects/cvsroot/pgsql-server/src/port/kill.c,v
retrieving revision 1.2
diff -u -r1.2 kill.c
--- port/kill.c 24 Jun 2004 18:53:48 -  1.2
+++ port/kill.c 26 Aug 2004 14:58:28 -
@@ -26,7 +26,7 @@
BYTEsigRet = 0;
DWORD   bytes;
 
-   if (sig >= PG_SIGNAL_COUNT || sig <= 0)
+   if (sig >= PG_SIGNAL_COUNT || sig < 0)
{
errno = EINVAL;
return -1;

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] [pgsql-hackers-win32] postmaster.pid

2004-08-26 Thread Andrew Dunstan
Should we (if only for the sake of completeness) make the converse 
one-byte change in port/win32/signal.c?

It says:
void
pg_queue_signal(int signum)
{
   if (signum >= PG_SIGNAL_COUNT || signum < 0)
   return;
...
ISTM we should not ever queue any event for signal 0.
cheers
andrew
Dave Page wrote:

 

-Original Message-
From: Magnus Hagander [mailto:[EMAIL PROTECTED] 
Sent: 25 August 2004 14:59
To: Tom Lane
Cc: Dave Page; [EMAIL PROTECTED]
Subject: RE: [pgsql-hackers-win32] postmaster.pid 

Ok, if you say so :-) I had the general impression we wanted 
that. But then let's go with the 
send-signal-0-down-the-pipe-and-ignore-it-in-the-backend. :-)
   

Here's the massive 1 byte change required to do just that :-)
Regards, Dave.
===
RCS file: /projects/cvsroot/pgsql-server/src/port/kill.c,v
retrieving revision 1.2
diff -u -r1.2 kill.c
--- kill.c  24 Jun 2004 18:53:48 -  1.2
+++ kill.c  26 Aug 2004 14:07:49 -
@@ -26,7 +26,7 @@
BYTEsigRet = 0;
DWORD   bytes;
-   if (sig >= PG_SIGNAL_COUNT || sig <= 0)
+   if (sig >= PG_SIGNAL_COUNT || sig < 0)
{
errno = EINVAL;
return -1;
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
 

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PATCHES] [pgsql-hackers-win32] postmaster.pid

2004-08-26 Thread Dave Page
 

> -Original Message-
> From: Magnus Hagander [mailto:[EMAIL PROTECTED] 
> Sent: 25 August 2004 14:59
> To: Tom Lane
> Cc: Dave Page; [EMAIL PROTECTED]
> Subject: RE: [pgsql-hackers-win32] postmaster.pid 
> 
> Ok, if you say so :-) I had the general impression we wanted 
> that. But then let's go with the 
> send-signal-0-down-the-pipe-and-ignore-it-in-the-backend. :-)

Here's the massive 1 byte change required to do just that :-)

Regards, Dave.


===
RCS file: /projects/cvsroot/pgsql-server/src/port/kill.c,v
retrieving revision 1.2
diff -u -r1.2 kill.c
--- kill.c  24 Jun 2004 18:53:48 -  1.2
+++ kill.c  26 Aug 2004 14:07:49 -
@@ -26,7 +26,7 @@
BYTEsigRet = 0;
DWORD   bytes;
 
-   if (sig >= PG_SIGNAL_COUNT || sig <= 0)
+   if (sig >= PG_SIGNAL_COUNT || sig < 0)
{
errno = EINVAL;
return -1;

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])