[ 
https://issues.apache.org/jira/browse/HIVE-25113?focusedWorklogId=596440&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-596440
 ]

ASF GitHub Bot logged work on HIVE-25113:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/May/21 00:49
            Start Date: 14/May/21 00:49
    Worklog Time Spent: 10m 
      Work Description: kishendas commented on pull request #2272:
URL: https://github.com/apache/hive/pull/2272#issuecomment-840920625


   Can you write simple tests to ensure these methods are reusing the existing 
connection, if its not null ? 
   May be you can mock Connection ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 596440)
    Time Spent: 20m  (was: 10m)

> Connection starvation in TxnHandler.getValidWriteIds
> ----------------------------------------------------
>
>                 Key: HIVE-25113
>                 URL: https://issues.apache.org/jira/browse/HIVE-25113
>             Project: Hive
>          Issue Type: Bug
>          Components: Transactions
>            Reporter: Yu-Wen Lai
>            Assignee: Yu-Wen Lai
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
>  
> The current code looks like below.
> {code:java}
> dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
> validTxnList = TxnUtils.createValidReadTxnList(getOpenTxns(), 0);
> {code}
> In the function getOpenTxns, it will request another connection from pool. 
> That is, this thread already held a connection, however, it would request for 
> another connection. When there are more than 10 (default connection pool 
> size) simultaneous getValidWriteIds requests, it can cause a starvation 
> problem. In that situation, each thread holds a connection and waits for 
> another connection. Then, we will see the following exception after timeout.
> {code:java}
> metastore.RetryingHMSHandler: MetaException(message:Unable to select from 
> transaction database, java.sql.SQLTransientConnectionException: HikariPool-3 
> - Connection is not available, request timed out after 30000ms.{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to