Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
0c1669c8
Commit
0c1669c8
authored
Nov 10, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructure child-exit logging messages for easier translation,
per suggestion from Peter.
parent
ec438886
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
34 deletions
+22
-34
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+22
-34
No files found.
src/backend/postmaster/postmaster.c
View file @
0c1669c8
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.25
8 2001/11/06 18:02:48
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.25
9 2001/11/10 23:06:12
tgl Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -240,7 +240,7 @@ static void reaper(SIGNAL_ARGS);
...
@@ -240,7 +240,7 @@ static void reaper(SIGNAL_ARGS);
static
void
sigusr1_handler
(
SIGNAL_ARGS
);
static
void
sigusr1_handler
(
SIGNAL_ARGS
);
static
void
dummy_handler
(
SIGNAL_ARGS
);
static
void
dummy_handler
(
SIGNAL_ARGS
);
static
void
CleanupProc
(
int
pid
,
int
exitstatus
);
static
void
CleanupProc
(
int
pid
,
int
exitstatus
);
static
const
char
*
formatExitStatus
(
int
exitstatus
);
static
void
LogChildExit
(
const
char
*
procname
,
int
pid
,
int
exitstatus
);
static
int
DoBackend
(
Port
*
port
);
static
int
DoBackend
(
Port
*
port
);
static
void
ExitPostmaster
(
int
status
);
static
void
ExitPostmaster
(
int
status
);
static
void
usage
(
const
char
*
);
static
void
usage
(
const
char
*
);
...
@@ -1544,8 +1544,8 @@ reaper(SIGNAL_ARGS)
...
@@ -1544,8 +1544,8 @@ reaper(SIGNAL_ARGS)
*/
*/
if
(
pgstat_ispgstat
(
pid
))
if
(
pgstat_ispgstat
(
pid
))
{
{
elog
(
DEBUG
,
"statistics collector process (pid %d) %s"
,
LogChildExit
(
gettext
(
"statistics collector process"
)
,
pid
,
formatExitStatus
(
exitstatus
)
);
pid
,
exitstatus
);
pgstat_start
();
pgstat_start
();
continue
;
continue
;
}
}
...
@@ -1557,8 +1557,8 @@ reaper(SIGNAL_ARGS)
...
@@ -1557,8 +1557,8 @@ reaper(SIGNAL_ARGS)
{
{
if
(
exitstatus
!=
0
)
if
(
exitstatus
!=
0
)
{
{
elog
(
DEBUG
,
"shutdown process (pid %d) %s"
,
LogChildExit
(
gettext
(
"shutdown process"
)
,
pid
,
formatExitStatus
(
exitstatus
)
);
pid
,
exitstatus
);
ExitPostmaster
(
1
);
ExitPostmaster
(
1
);
}
}
ExitPostmaster
(
0
);
ExitPostmaster
(
0
);
...
@@ -1568,8 +1568,9 @@ reaper(SIGNAL_ARGS)
...
@@ -1568,8 +1568,9 @@ reaper(SIGNAL_ARGS)
{
{
if
(
exitstatus
!=
0
)
if
(
exitstatus
!=
0
)
{
{
elog
(
DEBUG
,
"startup process (pid %d) %s; aborting startup"
,
LogChildExit
(
gettext
(
"startup process"
),
pid
,
formatExitStatus
(
exitstatus
));
pid
,
exitstatus
);
elog
(
DEBUG
,
"aborting startup due to startup process failure"
);
ExitPostmaster
(
1
);
ExitPostmaster
(
1
);
}
}
StartupPID
=
0
;
StartupPID
=
0
;
...
@@ -1639,8 +1640,6 @@ reaper_done:
...
@@ -1639,8 +1640,6 @@ reaper_done:
* CleanupProc -- cleanup after terminated backend.
* CleanupProc -- cleanup after terminated backend.
*
*
* Remove all local state associated with backend.
* Remove all local state associated with backend.
*
* Dillon's note: should log child's exit status in the system log.
*/
*/
static
void
static
void
CleanupProc
(
int
pid
,
CleanupProc
(
int
pid
,
...
@@ -1651,8 +1650,7 @@ CleanupProc(int pid,
...
@@ -1651,8 +1650,7 @@ CleanupProc(int pid,
Backend
*
bp
;
Backend
*
bp
;
if
(
DebugLvl
)
if
(
DebugLvl
)
elog
(
DEBUG
,
"CleanupProc: child process (pid %d) %s"
,
LogChildExit
(
gettext
(
"child process"
),
pid
,
exitstatus
);
pid
,
formatExitStatus
(
exitstatus
));
/*
/*
* If a backend dies in an ugly way (i.e. exit status not 0) then we
* If a backend dies in an ugly way (i.e. exit status not 0) then we
...
@@ -1697,8 +1695,7 @@ CleanupProc(int pid,
...
@@ -1697,8 +1695,7 @@ CleanupProc(int pid,
/* Make log entry unless we did so already */
/* Make log entry unless we did so already */
if
(
!
FatalError
)
if
(
!
FatalError
)
{
{
elog
(
DEBUG
,
"server process (pid %d) %s"
,
LogChildExit
(
gettext
(
"server process"
),
pid
,
exitstatus
);
pid
,
formatExitStatus
(
exitstatus
));
elog
(
DEBUG
,
"terminating any other active server processes"
);
elog
(
DEBUG
,
"terminating any other active server processes"
);
}
}
...
@@ -1756,33 +1753,24 @@ CleanupProc(int pid,
...
@@ -1756,33 +1753,24 @@ CleanupProc(int pid,
}
}
/*
/*
* Convert a wait(2) exit status into a printable string.
* Log the death of a child process.
*
* For present uses, it's okay to use a static return area here.
*/
*/
static
const
char
*
static
void
formatExitStatus
(
int
exitstatus
)
LogChildExit
(
const
char
*
procname
,
int
pid
,
int
exitstatus
)
{
{
static
char
result
[
100
];
/*
/*
* translator: the
se strings provide the verb phrase in the preceding
* translator: the
first %s in these messages is a noun phrase
*
messages such as "server process (pid %d) %
s"
*
describing a child process, such as "server proces
s"
*/
*/
if
(
WIFEXITED
(
exitstatus
))
if
(
WIFEXITED
(
exitstatus
))
snprintf
(
result
,
sizeof
(
result
),
elog
(
DEBUG
,
"%s (pid %d) exited with exit code %d"
,
gettext
(
"exited with exit code %d"
),
procname
,
pid
,
WEXITSTATUS
(
exitstatus
));
WEXITSTATUS
(
exitstatus
));
else
if
(
WIFSIGNALED
(
exitstatus
))
else
if
(
WIFSIGNALED
(
exitstatus
))
snprintf
(
result
,
sizeof
(
result
),
elog
(
DEBUG
,
"%s (pid %d) was terminated by signal %d"
,
gettext
(
"was terminated by signal %d"
),
procname
,
pid
,
WTERMSIG
(
exitstatus
));
WTERMSIG
(
exitstatus
));
else
else
snprintf
(
result
,
sizeof
(
result
),
elog
(
DEBUG
,
"%s (pid %d) exited with unexpected status %d"
,
gettext
(
"exited with unexpected status %d"
),
procname
,
pid
,
exitstatus
);
exitstatus
);
return
result
;
}
}
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment