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

Josh Elser commented on PHOENIX-5812:
-------------------------------------

bq. I prefer last interaction time to connection open time

+1

bq. Oracle provides a connection lifetime parameter on the connection level.  
We could easily do that and provide a default connection lifetime parameter 
default to infinite.  I think that gives the largest control to the end user, 
solves most lifetime problems by configuring a default connection lifetime to a 
reasonable value. 

I like the line of thinking behind this. Provide the ability for someone who is 
running into leaked connections to set a lifetime to stem systems "breaking".

bq. his concern is more about some "idle" connections being closed 
unnecessarily when the overall load is relatively light.

Is it possible to handle whether or not the HConnection is open/closed as an 
implementation detail? For example, could I hold on to one PhoenixConnection as 
a user, but the backing HConnection gets closed if I don't use it for such an 
amount of time AND when I do come back to that PConnection, the HConnection is 
automatically re-created?

This would solve a lot of client "frustration" like problems where an 
application has to watch for a specific non-JDBC exception and then take some 
special steps to manage it. I will admit, it may not be easy to implement this, 
given the state of CQSI. Just a thought :)

It sounds like you all are thinking about this with the right considerations. 
If there is anything I can recommend, it would be to suggest that the 
improvement be as least-user-facing as possible (e.g. I should never have to 
change my code to "work with" this feature). And, please make sure a clear plan 
for what y'all are going to build get's written down somewhere so devs and 
users can figure out how it works :)

> 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