ThriftHBaseServiceHandler.openScanner() does this:
1. table = pool.getTable()
2. scanner = table.getScanner()
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.