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
bb892cec
Commit
bb892cec
authored
Aug 04, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak postmaster code to avoid double reporting when bgwriter crashes.
parent
5cc38649
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
+13
-19
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+13
-19
No files found.
src/backend/postmaster/postmaster.c
View file @
bb892cec
...
...
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.41
8 2004/08/01 17:45:43
tgl Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.41
9 2004/08/04 20:09:47
tgl Exp $
*
* NOTES
*
...
...
@@ -248,8 +248,8 @@ static void pmdie(SIGNAL_ARGS);
static
void
reaper
(
SIGNAL_ARGS
);
static
void
sigusr1_handler
(
SIGNAL_ARGS
);
static
void
dummy_handler
(
SIGNAL_ARGS
);
static
void
Cleanup
Proc
(
int
pid
,
int
exitstatus
);
static
void
HandleChildCrash
(
int
pid
,
int
exitstatus
);
static
void
Cleanup
Backend
(
int
pid
,
int
exitstatus
);
static
void
HandleChildCrash
(
int
pid
,
int
exitstatus
,
const
char
*
procname
);
static
void
LogChildExit
(
int
lev
,
const
char
*
procname
,
int
pid
,
int
exitstatus
);
static
int
BackendRun
(
Port
*
port
);
...
...
@@ -1947,7 +1947,7 @@ reaper(SIGNAL_ARGS)
while
((
pid
=
win32_waitpid
(
&
exitstatus
))
>
0
)
{
/*
* We need to do this here, and not in Cleanup
Proc
, since this is
* We need to do this here, and not in Cleanup
Backend
, since this is
* to be called on all children when we are done with them. Could
* move to LogChildExit, but that seems like asking for future
* trouble...
...
...
@@ -2025,9 +2025,8 @@ reaper(SIGNAL_ARGS)
/*
* Any unexpected exit of the bgwriter is treated as a crash.
*/
LogChildExit
(
LOG
,
gettext
(
"background writer process"
),
pid
,
exitstatus
);
HandleChildCrash
(
pid
,
exitstatus
);
HandleChildCrash
(
pid
,
exitstatus
,
gettext
(
"background writer process"
));
continue
;
}
...
...
@@ -2067,7 +2066,7 @@ reaper(SIGNAL_ARGS)
/*
* Else do standard backend child cleanup.
*/
Cleanup
Proc
(
pid
,
exitstatus
);
Cleanup
Backend
(
pid
,
exitstatus
);
}
/* loop over pending child-death reports */
if
(
FatalError
)
...
...
@@ -2116,13 +2115,13 @@ reaper_done:
/*
* Cleanup
Proc
-- cleanup after terminated backend.
* Cleanup
Backend
-- cleanup after terminated backend.
*
* Remove all local state associated with backend.
*/
static
void
Cleanup
Proc
(
int
pid
,
int
exitstatus
)
/* child's exit status. */
Cleanup
Backend
(
int
pid
,
int
exitstatus
)
/* child's exit status. */
{
Dlelem
*
curr
;
...
...
@@ -2136,7 +2135,7 @@ CleanupProc(int pid,
*/
if
(
exitstatus
!=
0
)
{
HandleChildCrash
(
pid
,
exitstatus
);
HandleChildCrash
(
pid
,
exitstatus
,
gettext
(
"server process"
)
);
return
;
}
...
...
@@ -2166,8 +2165,7 @@ CleanupProc(int pid,
* process, and to signal all other remaining children to quickdie.
*/
static
void
HandleChildCrash
(
int
pid
,
int
exitstatus
)
/* child's exit status. */
HandleChildCrash
(
int
pid
,
int
exitstatus
,
const
char
*
procname
)
{
Dlelem
*
curr
,
*
next
;
...
...
@@ -2179,11 +2177,7 @@ HandleChildCrash(int pid,
*/
if
(
!
FatalError
)
{
LogChildExit
(
LOG
,
(
pid
==
BgWriterPID
)
?
gettext
(
"background writer process"
)
:
gettext
(
"server process"
),
pid
,
exitstatus
);
LogChildExit
(
LOG
,
procname
,
pid
,
exitstatus
);
ereport
(
LOG
,
(
errmsg
(
"terminating any other active server processes"
)));
}
...
...
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