提交 1c387807 编写于 作者: T Todd Sedano

Revert "fix bug : gpload does not stop after informatica sends exit call (#3089)"

We believe the pipeline is red due to this commit:
https://github.com/greenplum-db/gpdb/commits/fdc9e0a2812dbb01f0883c570f90d82397e2c573

The PR pipeline is red when it was pushed:
https://github.com/greenplum-db/gpdb/pull/3089
上级 7982f102
......@@ -98,15 +98,6 @@ static void flush_ssl_buffer(int fd, short event, void* arg);
/* SSL end */
#endif
/* signal handler global flag for asyc function*/
volatile static int sig_flag = 0;
void asyc_signal_handler(void);
#define CHECK_SIGNAL() do { \
if (sig_flag == SIGINT || sig_flag == SIGTERM) \
{ \
asyc_signal_handler(); \
} \
} while(0)
/**************
NOTE on GP_PROTO
......@@ -2177,7 +2168,6 @@ static void do_accept(int fd, short event, void* arg)
return;
failure:
CHECK_SIGNAL();
gwarning(NULL, "accept failed");
return;
}
......@@ -2538,28 +2528,23 @@ http_setup(void)
}
}
void
asyc_signal_handler(void )
{
gwarning(NULL, "signal %d received. gpfdist exits", sig_flag);
log_gpfdist_status();
fflush(stdout);
int i;
for (i = 0; i < gcb.listen_sock_count; i++)
{
if (gcb.listen_socks[i] > 0)
{
closesocket(gcb.listen_socks[i]);
}
}
exit(1);
}
void
process_signal(int sig)
{
sig_flag = sig;
if (sig == SIGINT || sig == SIGTERM)
{
gwarning(NULL, "signal %d received. gpfdist exits", sig);
log_gpfdist_status();
fflush(stdout);
int i;
for (i = 0; i < gcb.listen_sock_count; i++)
if (gcb.listen_socks[i] > 0)
{
closesocket(gcb.listen_socks[i]);
}
exit(1);
}
}
......@@ -3576,16 +3561,7 @@ int gpfdist_init(int argc, const char* const argv[])
int gpfdist_run()
{
struct timeval t;
t.tv_sec = 1;
t.tv_usec = 0;
for(;;)
{
event_loopexit(&t);
event_dispatch();
CHECK_SIGNAL();
}
return 0;
return event_dispatch();
}
#ifndef WIN32
......@@ -3985,9 +3961,7 @@ static SSL_CTX *initialize_ctx(void)
*/
static int gpfdist_socket_send(const request_t *r, const void *buf, const size_t buflen)
{
int ret = send(r->sock, buf, buflen, 0);
CHECK_SIGNAL();
return ret;
return send(r->sock, buf, buflen, 0);
}
#ifdef USE_SSL
......@@ -4001,7 +3975,6 @@ static int gpfdist_SSL_send(const request_t *r, const void *buf, const size_t bu
/* Write the data to socket */
int n = BIO_write(r->io, buf, buflen);
CHECK_SIGNAL();
/* Try to flush */
(void)BIO_flush(r->io);
......@@ -4047,9 +4020,7 @@ static int gpfdist_SSL_send(const request_t *r, const void *buf, const size_t bu
*/
static int gpfdist_socket_receive(const request_t *r, void *buf, const size_t buflen)
{
int ret = recv(r->sock, buf, buflen, 0);
CHECK_SIGNAL();
return ret;
return ( recv(r->sock, buf, buflen, 0) );
}
......@@ -4061,9 +4032,8 @@ static int gpfdist_socket_receive(const request_t *r, void *buf, const size_t bu
*/
static int gpfdist_SSL_receive(const request_t *r, void *buf, const size_t buflen)
{
int ret = BIO_read(r->io, buf, buflen);
CHECK_SIGNAL();
return ret;
return ( BIO_read(r->io, buf, buflen) );
/* todo: add error checks here */
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册