Skip to content

Commit

Permalink
Merge pull request #307 from arenadata/5.29.4-sync
Browse files Browse the repository at this point in the history
ADBDEV-2515 5.29.4 sync
  • Loading branch information
deart2k authored Feb 24, 2022
2 parents 9a91d26 + e53df10 commit c29f9dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]'
PACKAGE_URL=''

Expand Down
24 changes: 15 additions & 9 deletions src/bin/gpfdist/gpfdist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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)
{
Expand All @@ -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
Expand Down

0 comments on commit c29f9dd

Please sign in to comment.