[ 
https://issues.apache.org/jira/browse/DRILL-5316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15898909#comment-15898909
 ] 

ASF GitHub Bot commented on DRILL-5316:
---------------------------------------

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

    https://github.com/apache/drill/pull/772#discussion_r104606833
  
    --- Diff: contrib/native/client/src/clientlib/zookeeperClient.cpp ---
    @@ -138,6 +138,11 @@ int ZookeeperClient::getAllDrillbits(const 
std::string& connectStr, std::vector<
                 DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "\t Unshuffled Drillbit 
id: " << drillbits[i] << std::endl;)
             }
         }
    +    else{
    --- End diff --
    
    Agreed. Should be handled in caller (i.e. DrillClient). If the returned 
vector size is zero then we should check that in DrillClient and close client 
connection with error as `ERR_CONN_ZKNODBIT`. Something like below:
    
    `return handleConnError(CONN_INVALID_INPUT, getMessage(ERR_CONN_ZKNODBIT, 
pathToDrill.c_str()));`


> C++ Client Crashes When drillbitsVector.count is 0 after zoo_get_children 
> completed with ZOK
> --------------------------------------------------------------------------------------------
>
>                 Key: DRILL-5316
>                 URL: https://issues.apache.org/jira/browse/DRILL-5316
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - C++
>            Reporter: Rob Wu
>            Priority: Critical
>
> When connecting to drillbit with Zookeeper, occasionally the C++ client would 
> crash without any reason.
> A further look into the code revealed that during this call 
> rc=zoo_get_children(p_zh.get(), m_path.c_str(), 0, &drillbitsVector); 
> zoo_get_children returns ZOK (0) but drillbitsVector.count is 0.
> This causes drillbits to stay empty and thus 
> causes err = zook.getEndPoint(drillbits[drillbits.size() -1], endpoint); to 
> crash
> Size check should be done to prevent this from happening



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to