Skip to content

Commit

Permalink
Revert "Close connection to PXF when query to external table is cance…
Browse files Browse the repository at this point in the history
…led (#42)"

This reverts commit 21efde5.
  • Loading branch information
RekGRpth authored and andr-sokolov committed Oct 6, 2023
1 parent fbfff8c commit c6eed7e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
2 changes: 1 addition & 1 deletion external-table/src/pxfbridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ gpbridge_cleanup(gphadoop_context *context)
if (context == NULL)
return;

churl_cleanup(context->churl_handle, context->after_error);
churl_cleanup(context->churl_handle, false);
context->churl_handle = NULL;

churl_headers_cleanup(context->churl_headers);
Expand Down
1 change: 0 additions & 1 deletion external-table/src/pxfbridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ typedef struct
ProjectionInfo *proj_info;
List *quals;
bool completed;
bool after_error;
} gphadoop_context;

/*
Expand Down
19 changes: 0 additions & 19 deletions external-table/src/pxfprotocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "access/fileam.h"
#endif
#include "utils/elog.h"
#include "utils/resowner.h"

/* define magic module unless run as a part of test cases */
#ifndef UNIT_TESTING
Expand Down Expand Up @@ -155,21 +154,6 @@ pxfprotocol_import(PG_FUNCTION_ARGS)
PG_RETURN_INT32(bytes_read);
}

static void
url_curl_abort_callback(ResourceReleasePhase phase,
bool isCommit,
bool isTopLevel,
void *arg)
{
gphadoop_context *context = arg;

if (phase != RESOURCE_RELEASE_AFTER_LOCKS || isCommit || !isTopLevel)
return;

context->after_error = true;
cleanup_context(context);
}

/*
* Allocates context and sets values for the segment
*/
Expand Down Expand Up @@ -206,8 +190,6 @@ create_context(PG_FUNCTION_ARGS, bool is_import)
context->proj_info = proj_info;
context->quals = filter_quals;
context->completed = false;
context->after_error = false;
RegisterResourceReleaseCallback(url_curl_abort_callback, context);
return context;
}

Expand All @@ -219,7 +201,6 @@ cleanup_context(gphadoop_context *context)
{
if (context != NULL)
{
UnregisterResourceReleaseCallback(url_curl_abort_callback, context);
gpbridge_cleanup(context);
pfree(context->uri.data);
pfree(context);
Expand Down

0 comments on commit c6eed7e

Please sign in to comment.