Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
bb892cec
Commit
bb892cec
authored
20 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Tweak postmaster code to avoid double reporting when bgwriter crashes.
parent
5cc38649
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/postmaster/postmaster.c
+13
-19
13 additions, 19 deletions
src/backend/postmaster/postmaster.c
with
13 additions
and
19 deletions
src/backend/postmaster/postmaster.c
+
13
−
19
View file @
bb892cec
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.41
8
2004/08/0
1 17:45
:4
3
tgl Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.41
9
2004/08/0
4 20:09
:4
7
tgl Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -248,8 +248,8 @@ static void pmdie(SIGNAL_ARGS);
...
@@ -248,8 +248,8 @@ static void pmdie(SIGNAL_ARGS);
static
void
reaper
(
SIGNAL_ARGS
);
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
Cleanup
Proc
(
int
pid
,
int
exitstatus
);
static
void
Cleanup
Backend
(
int
pid
,
int
exitstatus
);
static
void
HandleChildCrash
(
int
pid
,
int
exitstatus
);
static
void
HandleChildCrash
(
int
pid
,
int
exitstatus
,
const
char
*
procname
);
static
void
LogChildExit
(
int
lev
,
const
char
*
procname
,
static
void
LogChildExit
(
int
lev
,
const
char
*
procname
,
int
pid
,
int
exitstatus
);
int
pid
,
int
exitstatus
);
static
int
BackendRun
(
Port
*
port
);
static
int
BackendRun
(
Port
*
port
);
...
@@ -1947,7 +1947,7 @@ reaper(SIGNAL_ARGS)
...
@@ -1947,7 +1947,7 @@ reaper(SIGNAL_ARGS)
while
((
pid
=
win32_waitpid
(
&
exitstatus
))
>
0
)
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
* to be called on all children when we are done with them. Could
* move to LogChildExit, but that seems like asking for future
* move to LogChildExit, but that seems like asking for future
* trouble...
* trouble...
...
@@ -2025,9 +2025,8 @@ reaper(SIGNAL_ARGS)
...
@@ -2025,9 +2025,8 @@ reaper(SIGNAL_ARGS)
/*
/*
* Any unexpected exit of the bgwriter is treated as a crash.
* Any unexpected exit of the bgwriter is treated as a crash.
*/
*/
LogChildExit
(
LOG
,
gettext
(
"background writer process"
),
HandleChildCrash
(
pid
,
exitstatus
,
pid
,
exitstatus
);
gettext
(
"background writer process"
));
HandleChildCrash
(
pid
,
exitstatus
);
continue
;
continue
;
}
}
...
@@ -2067,7 +2066,7 @@ reaper(SIGNAL_ARGS)
...
@@ -2067,7 +2066,7 @@ reaper(SIGNAL_ARGS)
/*
/*
* Else do standard backend child cleanup.
* Else do standard backend child cleanup.
*/
*/
Cleanup
Proc
(
pid
,
exitstatus
);
Cleanup
Backend
(
pid
,
exitstatus
);
}
/* loop over pending child-death reports */
}
/* loop over pending child-death reports */
if
(
FatalError
)
if
(
FatalError
)
...
@@ -2116,13 +2115,13 @@ reaper_done:
...
@@ -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.
* Remove all local state associated with backend.
*/
*/
static
void
static
void
Cleanup
Proc
(
int
pid
,
Cleanup
Backend
(
int
pid
,
int
exitstatus
)
/* child's exit status. */
int
exitstatus
)
/* child's exit status. */
{
{
Dlelem
*
curr
;
Dlelem
*
curr
;
...
@@ -2136,7 +2135,7 @@ CleanupProc(int pid,
...
@@ -2136,7 +2135,7 @@ CleanupProc(int pid,
*/
*/
if
(
exitstatus
!=
0
)
if
(
exitstatus
!=
0
)
{
{
HandleChildCrash
(
pid
,
exitstatus
);
HandleChildCrash
(
pid
,
exitstatus
,
gettext
(
"server process"
)
);
return
;
return
;
}
}
...
@@ -2166,8 +2165,7 @@ CleanupProc(int pid,
...
@@ -2166,8 +2165,7 @@ CleanupProc(int pid,
* process, and to signal all other remaining children to quickdie.
* process, and to signal all other remaining children to quickdie.
*/
*/
static
void
static
void
HandleChildCrash
(
int
pid
,
HandleChildCrash
(
int
pid
,
int
exitstatus
,
const
char
*
procname
)
int
exitstatus
)
/* child's exit status. */
{
{
Dlelem
*
curr
,
Dlelem
*
curr
,
*
next
;
*
next
;
...
@@ -2179,11 +2177,7 @@ HandleChildCrash(int pid,
...
@@ -2179,11 +2177,7 @@ HandleChildCrash(int pid,
*/
*/
if
(
!
FatalError
)
if
(
!
FatalError
)
{
{
LogChildExit
(
LOG
,
LogChildExit
(
LOG
,
procname
,
pid
,
exitstatus
);
(
pid
==
BgWriterPID
)
?
gettext
(
"background writer process"
)
:
gettext
(
"server process"
),
pid
,
exitstatus
);
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"terminating any other active server processes"
)));
(
errmsg
(
"terminating any other active server processes"
)));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment