Обсуждение: shutdown problems on win32

Поиск
Список
Период
Сортировка

shutdown problems on win32

От
Barry Lind
Дата:
I mentioned this a few days ago, but I have a little more information to
add.

The problem I reported was that I am having difficultly shutting down
the postmaster in the current win32 code base.  I start the postmaster
in a windows console and then am using ctrl-C to shut it down (is there
some other way to do this until the services code is added?).  What I am
seeing is that sometimes the postmaster doesn't respond to the ctrl-C
until much later.

The additional info I have is as follows:

1) startup the postmaster
2) ctrl-c it shuts down as expected

the case that doesn't work:

1) startup the postmaster
2) connect via psql
3) exit from psql
4) ctrl-c the postmaster it doesn't shutdown
5) connect via psql again (successfully)
6) exit psql
7) connect via psql again (this time connection will fail)
8) postmaster finally shutsdown

Here is what I have noticed that is strange:  when the postmaster starts
up I see three processes (the one postmaster process and two postgres
processes (stats collector processes I assume) which seems completely
normal.  However when I connect via psql I now see 5 processes, the one
postmaster and four postgres processes.  Whereas on linux I only see 4
(1 + 3).  Then when I exit psql only one of the two extra processes goes
away.  So after connecting via psql and exiting there is an extra
postgres process hanging around.  This doesn't happen on linux.  Is this
expected behavior?  Could this be contributing to my shutdown problems?

thanks,
--Barry


Re: shutdown problems on win32

От
Claudio Natoli
Дата:

> The problem I reported was that I am having difficultly shutting down
> the postmaster in the current win32 code base.  I start the postmaster
> in a windows console and then am using ctrl-C to shut it down (is there
> [snip]
>
> 8) postmaster finally shutsdown

This is most definitely due to the pgstat select/APC bug. See
http://archives.postgresql.org/pgsql-hackers-win32/2004-03/msg00041.php
or
http://archives.postgresql.org/pgsql-hackers/2004-03/msg00246.php

With CVS sources I can reproduce the described behaviour. With a local patch
for the above bug, the problem goes away.


> Here is what I have noticed that is strange:  when the  postmaster starts
> up I see three processes (the one postmaster process and two postgres
> processes (stats collector processes I assume) which seems completely
> normal.  However when I connect via psql I now see 5 processes, the one
> postmaster and four postgres processes.  Whereas on linux I
> only see 4  (1 + 3).  Then when I exit psql only one of the two extra
> processes goes away.

That is strange. I've got it too. Looks like the extra process is the
BackgroundWriter, and it is looping forever in BufferBackgroundWriter. I'll
look into it.


> linux.  Is this expected behavior?  Could this be contributing to my
shutdown
> problems?

No, on both counts.

Cheers,
Claudio

---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>

Re: shutdown problems on win32

От
Claudio Natoli
Дата:
[note to self: regardless of eagerness level, engage brain, check
assumptions, THEN post :-)]


> > Here is what I have noticed that is strange:  when the
[snip]
> > postmaster and four postgres processes.  Whereas on linux I
> > only see 4  (1 + 3).  Then when I exit psql only one of the two extra
> > processes goes away.
>
> That is strange. I've got it too. Looks like the extra process is the
> BackgroundWriter, and it is looping forever in
> BufferBackgroundWriter. I'll look into it.

Yep. It is sitting there, looping forever, doing exactly what it is supposed
to do afaics.

When you said "on linux", that wouldn't be a previous version of postgres
would it?


> > linux.  Is this expected behavior?  Could this be contributing to my
> > shutdown problems?
>
> No, on both counts.

Make that Yes for the first, No for the second.

Crawling back to my hole in great embarrassment,
Claudio

---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>

Re: shutdown problems on win32

От
Bruce Momjian
Дата:
Claudio Natoli wrote:
>
>
> > The problem I reported was that I am having difficultly shutting down
> > the postmaster in the current win32 code base.  I start the postmaster
> > in a windows console and then am using ctrl-C to shut it down (is there
> > [snip]
> >
> > 8) postmaster finally shutsdown
>
> This is most definitely due to the pgstat select/APC bug. See
> http://archives.postgresql.org/pgsql-hackers-win32/2004-03/msg00041.php
> or
> http://archives.postgresql.org/pgsql-hackers/2004-03/msg00246.php
>
> With CVS sources I can reproduce the described behaviour. With a local patch
> for the above bug, the problem goes away.

Magnus is still researching the APC issue.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: shutdown problems on win32

От
Barry Lind
Дата:

Claudio Natoli wrote:

>
> When you said "on linux", that wouldn't be a previous version of postgres
> would it?
>

I'm the one that should crawl back into a hole.  Comparing 7.4 on linux
to 7.5 on devel, what was I thinking :-)

I should have been able to figure that one out myself.

--Barry