Re: Win32 testing needed

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers-win32(at)postgresql(dot)org, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Win32 testing needed
Date: 2004-08-06 13:09:13
Message-ID: 411382F9.2060905@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

Tom Lane wrote:
> I have just committed a somewhat trimmed-down version of Andreas Pflug's
> syslogger patch. It seems to work okay on Unix (with or without
> EXEC_BACKEND) but I'm not in a position to test it on Windows. Would
> someone give it a try and report back? Please check in particular that
> the logger shuts down cleanly after the postmaster is gone.

Attached a patch with several issues resolved; only win32 checked.

After your changes, the error from ReadFile is not ERROR_HANDLE_EOF any
more, but ERROR_PIPE_BROKEN (which should be expected either), check is
done for both now.

The logger should *not* use proc_exit but exit(0), because proc_exit
might try to elog something, after we just closed the log file. IMHO
there's nothing left to cleanup anyway.

Changing setvbuf to use line buffered mode broke win32; apparently a
line is not a line there.... changed back to _IONBUF which should be
identical in result because we're always writing a complete line.

An observation I didn't track down so far:
Some LOG messages (e.g. the final logger shutdown, or "received fast
shutdown request") don't have proper CRLF line ending in win32, but only
LF.

If the logger subprocess is killed, it will come up again ok, but
redirecting to NULL_DEV doesn't work (open returns -1; that's what I had
realStdErr for). Opening c:\temp\dummy instead does help, but that's not
a solution. So what now? I'd propose inheriting the old stderr handle
instead of redirection_done so it can be reused in this case, as in my
original posting.

Finally, you don't seem to be a friend of a logfile rotation user
trigger... Please consider including it anyway.

Regards,
Andreas

Attachment Content-Type Size
logfile.patch text/x-patch 5.5 KB

In response to

Responses

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2004-08-06 14:17:07 Re: Win32 testing needed
Previous Message Andreas Pflug 2004-08-06 10:56:44 Re: Win32 testing needed