diff --git a/configure b/configure index 938a7840a407..f55e8f4fb854 100755 --- a/configure +++ b/configure @@ -582,8 +582,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Greenplum Database' PACKAGE_TARNAME='greenplum-database' -PACKAGE_VERSION='5.29.3' -PACKAGE_STRING='Greenplum Database 5.29.3' +PACKAGE_VERSION='5.29.4' +PACKAGE_STRING='Greenplum Database 5.29.4' PACKAGE_BUGREPORT='support@greenplum.org' PACKAGE_URL='' diff --git a/src/bin/gpfdist/gpfdist.c b/src/bin/gpfdist/gpfdist.c index 5e05a7395a6e..2bce98a4fdbb 100644 --- a/src/bin/gpfdist/gpfdist.c +++ b/src/bin/gpfdist/gpfdist.c @@ -1177,8 +1177,15 @@ static int local_send(request_t *r, const char* buf, int buflen) { gwarning(r, "gpfdist_send failed - the connection was terminated by the client (%d: %s)", e, strerror(e)); /* close stream and release fd & flock on pipe file*/ - if (r->session) + if (r->session && r->is_get) session_end(r->session, 0); + /* For post requests, the error msg may not be transmited + * to the client side because of network failure. So the + * session has to be set an error to inform the client + * through the following request response with an + * internal error. */ + else if (r->session && !r->is_get) + session_end(r->session, 1); } else { if (!ok) { gwarning(r, "gpfdist_send failed - due to (%d: %s)", e, strerror(e)); @@ -1655,6 +1662,13 @@ static int session_attach(request_t* r) /* found a session in hashtable*/ + /* if error, send an error and close */ + if (session->is_error) + { + http_error(r, FDIST_INTERNAL_ERROR, "session error"); + request_end(r, 1, 0); + return -1; + } /* session already ended. send an empty response, and close. */ if (NULL == session->fstream) { @@ -1665,14 +1679,6 @@ static int session_attach(request_t* r) return -1; } - /* if error, send an error and close */ - if (session->is_error) - { - http_error(r, FDIST_INTERNAL_ERROR, "session error"); - request_end(r, 1, 0); - return -1; - } - /* * disallow mixing GET and POST requests in one session. * this will protect us from an infinitely running