drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject [5/5] drill git commit: DRILL-2509: C++ client - concurrency issue with m_pendingRequests
Date Tue, 24 Mar 2015 19:41:11 GMT
DRILL-2509: C++ client - concurrency issue with m_pendingRequests


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/bebfe8ae
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/bebfe8ae
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/bebfe8ae

Branch: refs/heads/master
Commit: bebfe8ae92669dab0891e216d391297d6187a745
Parents: 2f2338f
Author: Parth Chandra <pchandra@maprtech.com>
Authored: Fri Mar 20 16:15:03 2015 -0700
Committer: Parth Chandra <pchandra@maprtech.com>
Committed: Tue Mar 24 12:12:19 2015 -0700

----------------------------------------------------------------------
 contrib/native/client/src/clientlib/drillClientImpl.cpp | 4 +++-
 contrib/native/client/src/clientlib/drillClientImpl.hpp | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/bebfe8ae/contrib/native/client/src/clientlib/drillClientImpl.cpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.cpp b/contrib/native/client/src/clientlib/drillClientImpl.cpp
index e6f8009..d14119d 100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.cpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.cpp
@@ -346,7 +346,8 @@ DrillClientQueryResult* DrillClientImpl::SubmitQuery(::exec::shared::QueryType
t
     uint64_t coordId;
     DrillClientQueryResult* pQuery=NULL;
     {
-        boost::lock_guard<boost::mutex> lock(this->m_dcMutex);
+        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);
@@ -782,6 +783,7 @@ void DrillClientImpl::handleRead(ByteBuf_t _buf,
     }
     if(!error){
         InBoundRpcMessage msg;
+        boost::lock_guard<boost::mutex> lock(this->m_prMutex);
 
         DRILL_LOG(LOG_TRACE) << "Getting new message" << std::endl;
         AllocatedBufferPtr allocatedBuffer=NULL;

http://git-wip-us.apache.org/repos/asf/drill/blob/bebfe8ae/contrib/native/client/src/clientlib/drillClientImpl.hpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClientImpl.hpp b/contrib/native/client/src/clientlib/drillClientImpl.hpp
index a6de40b..33f81db 100644
--- a/contrib/native/client/src/clientlib/drillClientImpl.hpp
+++ b/contrib/native/client/src/clientlib/drillClientImpl.hpp
@@ -306,6 +306,8 @@ class DrillClientImpl{
         // number of outstanding read requests.
         // handleRead will keep asking for more results as long as this number is not zero.
         size_t m_pendingRequests;
+        //mutex to protect m_pendingRequests
+        boost::mutex m_prMutex;
 
         // Error Object. NULL if no error. Set if the error is valid for ALL running queries.
         // All the query result objects will


Mime
View raw message