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

Chinmay Kulkarni commented on PHOENIX-5812:
-------------------------------------------

[~dbwong] +1 I think that is a cleaner approach. [Oracle 
docs|https://docs.oracle.com/cd/B14117_01/win.101/b10117/features001.htm] 
explain the lifetime parameter to be enforced only when a connection is going 
back to the pool. It seems to be evaluated only on connection closing. 
So, I'm guessing we want a different implementation than that, wherein we could 
have a watcher thread in each CQS which keeps track of opened connection's 
elapsed times, and a check each time a connection is used to check that the 
elapsed time isn't past the lifetime of the connection.
As with many other connection-level properties, we can have a default 
connection lifetime set for each CQS and a possible override when creating the 
connection as _DriverManager.getConnection(url, props)_.

> Automatically Close "Idle" Long Open Connections
> ------------------------------------------------
>
>                 Key: PHOENIX-5812
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5812
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Daniel Wong
>            Priority: Major
>
> As Phoenix may keep a maximum default number of connections.  Badly 
> performing client calls or internal errors (See PHOENIX-5802).  Can cause 
> total available connections to go to 0.  Proposing a client connection 
> monitor with a connection reaper like task to reap idle connections.
> Definition of "Idle"
> Simple may be simple time based say if a connection has been open for 
> configurable amount of minutes simply close.
> More complicated solution may be keeping track of last interaction time.



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

Reply via email to