Github user interma commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1072#discussion_r94203891
  
    --- Diff: src/backend/libpq/rangerrest.c ---
    @@ -49,10 +49,26 @@ char* AclObjectKindStr[] =
        "none"               /* MUST BE LAST */
     };
     
    +static int request_id = 1;
    +
    +void getClientIP(char *remote_host)
    +{
    +   Port *port = MyProcPort;
    +   char remote_port[32];
    +   remote_port[0] = '\0';
    +
    +   int ret = pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
    +                                   remote_host, sizeof(remote_host),
    +                                   remote_port,     sizeof(remote_port),
    +                                   NI_NUMERICHOST | NI_NUMERICSERV);
    +   if (ret){
    +           elog(LOG,"cannot get clientIP. pg_getnameinfo_all() failed: 
%s", gai_strerror(ret));
    +   }
    +   elog(DEBUG3, "get clientIP when building json request : %s", 
remote_host);
    +}
     RangerACLResult parse_ranger_response(char* buffer)
     {
    -   Assert(buffer != NULL);
    -   if (strlen(buffer) == 0)
    +   if (buffer == NULL || strlen(buffer) == 0)
    --- End diff --
    
    Thanks @stanlyxiang
    If RPS reponse is empty and not --enable-cassert, will cause hawq process 
to core dump in *parse_ranger_response()*.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to