drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From parthchandra <...@git.apache.org>
Subject [GitHub] drill pull request #493: DRILL-4647: C++ client fails to propagate a dead co...
Date Wed, 06 Jul 2016 01:57:19 GMT
Github user parthchandra commented on a diff in the pull request:

    https://github.com/apache/drill/pull/493#discussion_r69666212
  
    --- Diff: contrib/native/client/src/clientlib/drillClientImpl.cpp ---
    @@ -469,34 +471,50 @@ DrillClientQueryResult* DrillClientImpl::SubmitQuery(::exec::shared::QueryType
t
     
         uint64_t coordId;
         DrillClientQueryResult* pQuery=NULL;
    +    connectionStatus_t cStatus=CONN_SUCCESS;
         {
             boost::lock_guard<boost::mutex> prLock(this->m_prMutex);
             boost::lock_guard<boost::mutex> dcLock(this->m_dcMutex);
             coordId = this->getNextCoordinationId();
             OutBoundRpcMessage out_msg(exec::rpc::REQUEST, exec::user::RUN_QUERY, coordId,
&query);
    -        sendSync(out_msg);
     
    +        // Create the result object and register the listener before we send the query
    +        // because sometimes the caller is not checking the status of the submitQuery
call.
    +        // This way, the broadcast error call will cause the results listener to be called
    +        // with a COMM_ERROR status.
             pQuery = new DrillClientQueryResult(this, coordId, plan);
             pQuery->registerListener(l, lCtx);
    -        bool sendRequest=false;
             this->m_queryIds[coordId]=pQuery;
     
    -        DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG)  << "Sent query request. " << "["
<< m_connectedHost << "]"  << "Coordination id = " << coordId <<
std::endl;)
    -        DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG)  << "Sent query " <<  "Coordination
id = " << coordId << " query: " << plan << std::endl;)
    +        connectionStatus_t cStatus=sendSync(out_msg);
    +        if(cStatus == CONN_SUCCESS){
    +            bool sendRequest=false;
     
    -        if(m_pendingRequests++==0){
    -            sendRequest=true;
    -        }else{
    -            DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "Queueing query request to server"
<< std::endl;)
    -            DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "Number of pending requests =
" << m_pendingRequests << std::endl;)
    -        }
    -        if(sendRequest){
    -            DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "Sending query request. Number
of pending requests = "
    -                << m_pendingRequests << std::endl;)
    -            getNextResult(); // async wait for results
    +            DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG)  << "Sent query request. " <<
"[" << m_connectedHost << "]"  << "Coordination id = " << coordId
<< std::endl;)
    +                DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG)  << "Sent query " <<  "Coordination
id = " << coordId << " query: " << plan << std::endl;)
    +
    +                if(m_pendingRequests++==0){
    +                    sendRequest=true;
    +                }else{
    +                    DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "Queueing query request
to server" << std::endl;)
    +                        DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "Number of pending
requests = " << m_pendingRequests << std::endl;)
    +                }
    +            if(sendRequest){
    +                DRILL_MT_LOG(DRILL_LOG(LOG_DEBUG) << "Sending query request. Number
of pending requests = "
    +                        << m_pendingRequests << std::endl;)
    +                    getNextResult(); // async wait for results
    +            }
             }
    +
    +    }
    +    if(cStatus!=CONN_SUCCESS){
    --- End diff --
    
    No. If there is a failure in sending, then the sendSync calls handleConnError which fails
all the other pending queries (it call broadcastError).
    The block above simple removes the queryId for this query from the list of queries currently
executing.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message