Repository: incubator-hawq
Updated Branches:
  refs/heads/master 80e25b468 -> 0bc49a345


HAWQ-848. Bugfix: gpfdist report "Failed initialization (url.c:1671)"


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/0bc49a34
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/0bc49a34
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/0bc49a34

Branch: refs/heads/master
Commit: 0bc49a345bb97d3d64980164b0fa9e4601c5953d
Parents: 80e25b4
Author: xunzhang <[email protected]>
Authored: Tue Jun 21 22:51:20 2016 +0800
Committer: xunzhang <[email protected]>
Committed: Tue Jun 21 22:54:35 2016 +0800

----------------------------------------------------------------------
 src/backend/access/external/url.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0bc49a34/src/backend/access/external/url.c
----------------------------------------------------------------------
diff --git a/src/backend/access/external/url.c 
b/src/backend/access/external/url.c
index 37baac4..62a7ce0 100644
--- a/src/backend/access/external/url.c
+++ b/src/backend/access/external/url.c
@@ -1028,16 +1028,6 @@ url_fopen(char *url,
                        }
                }
 
-        if (CURLE_OK != (e = curl_multi_add_handle(multi_handle, 
file->u.curl.handle)))
-               {
-                       if (CURLM_CALL_MULTI_PERFORM != e)
-                       {
-                               url_fclose(file, false, pstate->cur_relname);
-                               elog(ERROR, "internal error: 
curl_multi_add_handle failed (%d - %s)",
-                                        e, curl_easy_strerror(e));
-                       }
-               }
-
         /* 
          * lets check our connection.
          * start the fetch if we're SELECTing (GET request), or write an
@@ -1045,6 +1035,15 @@ url_fopen(char *url,
          */
         if (!forwrite)
         {
+          if (CURLE_OK != (e = curl_multi_add_handle(multi_handle, 
file->u.curl.handle)))
+                     {
+                             if (CURLM_CALL_MULTI_PERFORM != e)
+                             {
+                                     url_fclose(file, false, 
pstate->cur_relname);
+                                     elog(ERROR, "internal error: 
curl_multi_add_handle failed (%d - %s)",
+                                               e, curl_easy_strerror(e));
+                             }
+                     }
             
                while (CURLM_CALL_MULTI_PERFORM ==
                           (e = curl_multi_perform(multi_handle, 
&file->u.curl.still_running)));

Reply via email to