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

    https://github.com/apache/drill/pull/726#discussion_r97665284
  
    --- Diff: contrib/native/client/src/clientlib/drillClientImpl.cpp ---
    @@ -179,9 +179,11 @@ connectionStatus_t DrillClientImpl::sendHeartbeat(){
     }
     
     void DrillClientImpl::resetHeartbeatTimer(){
    -    m_heartbeatTimer.cancel();
    -    DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "Reset Heartbeat timer." << 
std::endl;)
    -    startHeartbeatTimer();
    +    if (DrillClientConfig::getHeartbeatFrequency() > 0) {
    +        m_heartbeatTimer.cancel();
    --- End diff --
    
    I was wondering if one needs to cancel the timer, as startHearbeatTimer 
sets it again to expire. Maybe all this logic can be done in one place (like 
startHeartbeatTimer?)
    
    I also noticed another place where m_heartbeatTime.cancel() is called, in 
broadcastError. I guess this is fine (probably not an error of calling cancel() 
if not set, but haven't checked asio doc on it), but maybe this should be 
cleaned up/guarded too...


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

Reply via email to