You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by li...@apache.org on 2016/03/29 04:56:24 UTC
incubator-hawq git commit: HAWQ-568. Check validation the QD to QE
connection by checking whether the recv character is 'E' which means there's
error on the other side
Repository: incubator-hawq
Updated Branches:
refs/heads/master 7c9009f0c -> 61598138b
HAWQ-568. Check validation the QD to QE connection by checking whether the recv character is 'E' which means there's error on the other side
Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/61598138
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/61598138
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/61598138
Branch: refs/heads/master
Commit: 61598138b02e2336ad4a8e8e3116e4e5b8245dbd
Parents: 7c9009f
Author: Lili Ma <ic...@gmail.com>
Authored: Tue Mar 29 10:53:49 2016 +0800
Committer: Lili Ma <ic...@gmail.com>
Committed: Tue Mar 29 10:55:49 2016 +0800
----------------------------------------------------------------------
src/backend/cdb/dispatcher.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/61598138/src/backend/cdb/dispatcher.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/dispatcher.c b/src/backend/cdb/dispatcher.c
index f355b05..ad826d3 100644
--- a/src/backend/cdb/dispatcher.c
+++ b/src/backend/cdb/dispatcher.c
@@ -1851,9 +1851,13 @@ bool dispatch_validate_conn(pgsocket sock)
if (ret == 0) /* socket has been closed. EOF */
return false;
- if (ret > 0) /* data waiting on socket, it must be OK. */
- return true;
-
+ if (ret > 0) /* data waiting on socket */
+ {
+ if (buf == 'E') /* waiting data indicates error */
+ return false;
+ else
+ return true;
+ }
if (ret == -1) /* error, or would be block. */
{
if (errno == EAGAIN || errno == EINPROGRESS || errno == EWOULDBLOCK)