Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
612f1b01
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
612f1b01
编写于
10月 24, 2000
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Check for SIGHUP and process config file updates just after waiting
for input, not just before.
上级
4cafef5c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
47 deletion
+46
-47
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+31
-35
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+15
-12
未找到文件。
src/backend/postmaster/postmaster.c
浏览文件 @
612f1b01
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.17
3 2000/10/21 15:43:26 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.17
4 2000/10/24 21:33:52 tgl
Exp $
*
* NOTES
*
...
...
@@ -803,14 +803,15 @@ ServerLoop(void)
Port
*
port
;
fd_set
rmask
,
wmask
;
#ifdef USE_SSL
int
no_select
=
0
;
bool
no_select
=
false
;
#endif
memmove
((
char
*
)
&
rmask
,
(
char
*
)
&
readmask
,
sizeof
(
fd_set
));
memmove
((
char
*
)
&
wmask
,
(
char
*
)
&
writemask
,
sizeof
(
fd_set
));
/*
* Wait for something to happen.
*/
memcpy
((
char
*
)
&
rmask
,
(
char
*
)
&
readmask
,
sizeof
(
fd_set
));
memcpy
((
char
*
)
&
wmask
,
(
char
*
)
&
writemask
,
sizeof
(
fd_set
));
#ifdef USE_SSL
for
(
curr
=
DLGetHead
(
PortList
);
curr
;
curr
=
DLGetSucc
(
curr
))
...
...
@@ -818,17 +819,16 @@ ServerLoop(void)
if
(((
Port
*
)
DLE_VAL
(
curr
))
->
ssl
&&
SSL_pending
(((
Port
*
)
DLE_VAL
(
curr
))
->
ssl
)
>
0
)
{
no_select
=
1
;
no_select
=
true
;
break
;
}
}
PG_SETMASK
(
&
UnBlockSig
);
if
(
no_select
)
FD_ZERO
(
&
rmask
);
/* So we don't accept() anything below */
else
#else
PG_SETMASK
(
&
UnBlockSig
);
#endif
PG_SETMASK
(
&
UnBlockSig
);
if
(
select
(
nSockets
,
&
rmask
,
&
wmask
,
(
fd_set
*
)
NULL
,
(
struct
timeval
*
)
NULL
)
<
0
)
{
...
...
@@ -838,6 +838,21 @@ ServerLoop(void)
progname
,
strerror
(
errno
));
return
STATUS_ERROR
;
}
/*
* Block all signals until we wait again
*/
PG_SETMASK
(
&
BlockSig
);
/*
* Respond to signals, if needed
*/
if
(
got_SIGHUP
)
{
got_SIGHUP
=
false
;
ProcessConfigFile
(
PGC_SIGHUP
);
}
/*
* Select a random seed at the time of first receiving a request.
*/
...
...
@@ -856,11 +871,8 @@ ServerLoop(void)
}
/*
*
Block all signals
*
new connection pending on our well-known port's socket?
*/
PG_SETMASK
(
&
BlockSig
);
/* new connection pending on our well-known port's socket */
#ifdef HAVE_UNIX_SOCKETS
if
(
ServerSock_UNIX
!=
INVALID_SOCK
&&
...
...
@@ -893,21 +905,12 @@ ServerLoop(void)
Port
*
port
=
(
Port
*
)
DLE_VAL
(
curr
);
int
status
=
STATUS_OK
;
Dlelem
*
next
;
int
readyread
=
0
;
if
(
FD_ISSET
(
port
->
sock
,
&
rmask
)
#ifdef USE_SSL
if
(
port
->
ssl
)
{
if
(
SSL_pending
(
port
->
ssl
)
||
FD_ISSET
(
port
->
sock
,
&
rmask
))
readyread
=
1
;
}
else
||
(
port
->
ssl
&&
SSL_pending
(
port
->
ssl
))
#endif
if
(
FD_ISSET
(
port
->
sock
,
&
rmask
))
readyread
=
1
;
if
(
readyread
)
)
{
if
(
DebugLvl
>
1
)
fprintf
(
stderr
,
"%s: ServerLoop:
\t\t
handling reading %d
\n
"
,
...
...
@@ -997,13 +1000,7 @@ ServerLoop(void)
}
curr
=
next
;
}
if
(
got_SIGHUP
)
{
got_SIGHUP
=
false
;
ProcessConfigFile
(
PGC_SIGHUP
);
}
}
/* loop over active ports */
}
}
...
...
@@ -1269,7 +1266,6 @@ reset_shared(int port)
static
void
SIGHUP_handler
(
SIGNAL_ARGS
)
{
got_SIGHUP
=
true
;
if
(
Shutdown
>
SmartShutdown
)
return
;
got_SIGHUP
=
true
;
...
...
src/backend/tcop/postgres.c
浏览文件 @
612f1b01
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.18
0 2000/10/07 14:39:14 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.18
1 2000/10/24 21:33:48 tgl
Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -1618,7 +1618,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
if
(
!
IsUnderPostmaster
)
{
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"$Revision: 1.18
0 $ $Date: 2000/10/07 14:39:14
$
\n
"
);
puts
(
"$Revision: 1.18
1 $ $Date: 2000/10/24 21:33:48
$
\n
"
);
}
/*
...
...
@@ -1695,14 +1695,6 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
parser_input
=
makeStringInfo
();
/* XXX this could be moved after ReadCommand below to get more
* sensical behaviour */
if
(
got_SIGHUP
)
{
got_SIGHUP
=
false
;
ProcessConfigFile
(
PGC_SIGHUP
);
}
/* ----------------
* (1) tell the frontend we're ready for a new query.
*
...
...
@@ -1738,7 +1730,18 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
DisableNotifyInterrupt
();
/* ----------------
* (5) process the command.
* (5) check for any other interesting events that happened
* while we slept.
* ----------------
*/
if
(
got_SIGHUP
)
{
got_SIGHUP
=
false
;
ProcessConfigFile
(
PGC_SIGHUP
);
}
/* ----------------
* (6) process the command.
* ----------------
*/
switch
(
firstchar
)
...
...
@@ -1766,7 +1769,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
* ----------------
*/
case
'Q'
:
if
(
strspn
(
parser_input
->
data
,
"
\t\n
"
)
==
parser_input
->
len
)
if
(
strspn
(
parser_input
->
data
,
"
\t\
r\
n
"
)
==
parser_input
->
len
)
{
/* ----------------
* if there is nothing in the input buffer, don't bother
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录