-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-27658: Add max live time limit for cached connections #118
base: master
Are you sure you want to change the base?
Conversation
🎊 +1 overall
This message was automatically generated. |
so with this patch, even live connections will be cleaned up? isn't the purpose to clean the token expired connections? |
The connections that are being referenced will not be cleaned up. Lines 122 to 123 in 4415f28
After the connection creation time exceeds maxLifeTime, it will be moved into toCloseConnectionMap, which means it will no longer be newly referenced. The connection in toCloseConnectionMap is only released after there is no reference, and will not affect the active connection. |
This PR does not need to clean up the expired token connection, but to avoid token expiration by controlling the maximum usage time of the connection. The spark driver will periodically renew the token, if we do not reuse the connection for a long time, we can avoid the token expiration problem. It also seems difficult for us to judge whether the token of the connection has expired. |
the connection itself has a parameter to judge whether it is idle and to be cleaned up, can that para be used? |
For example, in the stream task, we execute a task to write to hbase every 5s, and setting the idle time of the connection to 10s means that the connection will not be cleaned up due to idleness. |
not really understand and still confused what's the difference with this block
it also has a why still need to introduce max live limit. |
As in the previous example, |
hmm, sounds like this logic is wrong, can we just update the timestamp logic here instead of introducing a new para |
I prefer that they are different logics.
Do you have any improvement suggestions? |
it is a wrong if your sayings is correct. and in fact what it does it just same to yours, to close timeout connections, so you could just modify the existed one to a correct one |
The timeout in the current logic means that the connection will be released after being idle for a period of time. For a batch application that accesses hbase for a period of time and then performs other work, it can reuse the connection and release it when appropriate. But for a continuously active streaming application, we cannot release the connection through idle timeout but add a maximum lifetime limit. I think both parameters are needed, they are suitable for different scenarios. |
Add max live time limit for cached connections to avoid token expiration for long active connections