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

Lars George edited comment on HBASE-7035 at 7/15/13 9:10 AM:
-------------------------------------------------------------

Looking at HBASE-4205, where this wording was added, it does not explain the 
reasons. For writing, this is clear, but not for reading. The 
[HTable|https://github.com/apache/hbase/blob/7f730d7742a523315db98d5adc879e67ed90350b/src/main/java/org/apache/hadoop/hbase/client/HTable.java]
 from back then (0.90.4) has changed a bit, and is now been given the 
connection reference directly, as opposed to be calling the method of the 
wrapping HTable instance. I'll raise this question up on dev@ to confirm the 
status quo.

But, assuming the reading path is thread safe, we should be fine overall, no? 
Then using the pool is doing the job needed, keeping the connection open. In 
other words, for 0.94+ we do not need your patch? Not wanting to ruin the show 
here, please forgive me. :)
                
      was (Author: larsgeorge):
    Looking at HBASE-4205, where this wording was added, it does not explain 
the reasons. For writing, this is clear, but not for reading. The 
[HTable\https://github.com/apache/hbase/blob/7f730d7742a523315db98d5adc879e67ed90350b/src/main/java/org/apache/hadoop/hbase/client/HTable.java]
 from back then (0.90.4) has changed a bit, and is now been given the 
connection reference directly, as opposed to be calling the method of the 
wrapping HTable instance. I'll raise this question up on dev@ to confirm the 
status quo.

But, assuming the reading path is thread safe, we should be fine overall, no? 
Then using the pool is doing the job needed, keeping the connection open. In 
other words, for 0.94+ we do not need your patch? Not wanting to ruin the show 
here, please forgive me. :)
                  
> thrift server closes HTable of open Scanners
> --------------------------------------------
>
>                 Key: HBASE-7035
>                 URL: https://issues.apache.org/jira/browse/HBASE-7035
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Thrift
>    Affects Versions: 0.94.4
>            Reporter: Devin Bayer
>              Labels: thrift2
>         Attachments: old-hbase-thrift-v1.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> ThriftHBaseServiceHandler.openScanner() does this:
> 1. table = pool.getTable()
> 2. scanner = table.getScanner()
> 3. table.close()
> 4. return scanner
> While back porting the thrift server to 0.92.6, I found that table.close() 
> calls connection.close(). Further calls to scanner.next() raise a 
> ConnectionClosed exception. The unit tests do not catch this since they reuse 
> an open HConnection instance.
> This might work on trunk, but depends on the implementations of HTablePool, 
> HTable and HConnectionManager. Even with the pool wrapper, if the pool is 
> full, table.close() may be called, which may invalidate the table. Also,  
> HTable is not thread-safe, but they are being reused since they go back in 
> the pool.
> I suggest storing the table handle along with the scanner.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to