Hi,

Currently the C++ client uses a variable, pendingRequests, to determine whether 
submitQuery or handleRead should call getNextResult. PendingRequests is 
incremented when a query is submitted (in submitQuery) and decrements when a 
query is completed or cancelled (in processQueryResult, which is called by 
handleRead). SubmitQuery will call getNextResult if pendingRequests is 0.  
Occasionally we have an issue with the C++ Drill Client where it hangs when a 
query is submitted just after pendingRequests is decremented in 
processQueryResult but before handleRead checks it. At this point submitQuery 
thinks pendingRequests is 0 so it calls getNextResult. Also, since a query is 
submitted, pendingRequests is incremented. HandleRead then checks the value for 
pendingRequests, which is now 1, so it also calls getNextResult. With both 
threads calling getNextResult, the client ends up hanging. (And for whatever 
reason, we end up getting a handshake response from the server, followed by a 
null QueryResult/QueryHandle response, and finally a handshake request, all 
from the server).
Any tips/suggestions to resolve this issue?

Norris

Reply via email to