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

Parth Chandra commented on DRILL-5659:
--------------------------------------

So, it looks like this:

The original code for reading (synchronously) from a socket looked like this:
{code}
     while(1){
        size_t dataBytesRead = m_socket.read_some(boost::asio::buffer(inBuf, 
bytesToRead),
                                           errorCode);
        if(errorCode){
            break;
        } 
       ...
    }
{code}

and now it looks like 
{code}
     while(1){
        size_t dataBytesRead = m_socket.read_some(boost::asio::buffer(inBuf, 
bytesToRead),
                                           errorCode);
        if(EINTR != errorCode.value()){
            break;
        } 
       ...
    }
{code}

The original works correctly and the new code doesn't. 

If {code}errorCode.value() == 0{code} we break out of the while loop even if we 
have not managed to read all the data off the socket. This typically will 
happen when there is a large data set and the server is returning data really, 
really fast so there is a lot of data in the socket stream.

Modifying the code to check for errorCode (which is equivalent to checking 
errorCode.value() != 0) first, makes everyone happy again. 

Will submit a patch after a little more testing.


> C++ Client (master) behavior is unstable resulting incorrect result or 
> exception in API calls
> ---------------------------------------------------------------------------------------------
>
>                 Key: DRILL-5659
>                 URL: https://issues.apache.org/jira/browse/DRILL-5659
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Rob Wu
>             Fix For: 1.11.0
>
>         Attachments: 1-10cppClient-1.10.0Drillbit-hive.log, 
> 1-10cppClient-1.10.0Drillbit-metadata and catalog test.log, 
> 1-10cppClient-1.9.0Drillbit-dfs.log, 1-10cppClient-1.9.0Drillbit-hive.log, 
> 1-10cppClient-1.9.0Drillbit-metadata and catalog test.log, 
> 1-11cppClient-1.10.0Drillbit-hive.log, 1-11cppClient-1.10.0Drillbit-metadata 
> and catalog test.log, 1-11cppClient-1.9.0Drillbit-dfs.log, 
> 1-11cppClient-1.9.0Drillbit-hive.log, 1-11cppClient-1.9.0Drillbit-metadata 
> and catalog test.log
>
>
> I recently compiled the C++ client (on windows) from master and tested 
> against a 1.9.0 drillbit. The client's behavior does not meet the stable 
> release requirement.
> Some API functionalities are broken and should be investigated.
> Most noticeable is the getColumns(...) call. It will throw an exception with 
> "Cannot decode getcolumns results" when the number of rows (column records) 
> exceeds a certain number. 
> I also noticed that: during query execution + data retrieval, if the table is 
> large enough, the result coming back will start to become NULL or empty.
> I will see if I can generate some drillclient logs to put in the attachment.
> I will also compile and test on other platforms.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to