Catch and report GTM errors correctly
authorPavan Deolasee <[email protected]>
Mon, 22 Oct 2018 10:54:47 +0000 (16:24 +0530)
committerPavan Deolasee <[email protected]>
Mon, 22 Oct 2018 10:55:05 +0000 (16:25 +0530)
If the connection with the GTM is dropped, we should ensure that the caller
gets to see the error. This fixes some of the issues noticed during GTM
stop/start tests.

src/gtm/client/fe-protocol.c

index fc3988d5591f9cfc0bfd262a60f820c74ddc50fd..d4be13803c1170cbc06f046199dc2463bd43cee7 100644 (file)
@@ -137,6 +137,7 @@ pqParseInput(GTM_Conn *conn)
                                                          "unexpected response from server; first received character was \"%c\"\n",
                                                          id);
                        conn->inCursor += msgLength;
+                       result->gr_status = GTM_RESULT_ERROR;
                        break;
        }                                       /* switch on protocol character */
        /* Successfully consumed this message */
@@ -148,6 +149,7 @@ pqParseInput(GTM_Conn *conn)
        else
        {
                /* Trouble --- report it */
+               result->gr_status = GTM_RESULT_ERROR;
                printfGTMPQExpBuffer(&conn->errorMessage,
                                                  "message contents do not agree with length in message type \"%c\"\n",
                                                  id);