[
https://issues.apache.org/jira/browse/SENTRY-1580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16022140#comment-16022140
]
Alexander Kolbasov commented on SENTRY-1580:
--------------------------------------------
Looking at SENTRY-296 it seems that it doesn't quite work.
The usual pattern for clients is:
1) Create a new connection using SentryPolicyServiceClient.create()
2) Issue a single call (or may be a few calls)
3) Close the client.
The create() method above creates a new instance of the
PoolClientInvocationHandler:
{code}
public static SentryPolicyServiceClient create(Configuration conf) throws
Exception {
boolean haEnabled = conf.getBoolean(ClientConfig.SERVER_HA_ENABLED, false);
boolean pooled = conf.getBoolean(ClientConfig.SENTRY_POOL_ENABLED, false);
if (pooled) {
return (SentryPolicyServiceClient) Proxy
.newProxyInstance(SentryPolicyServiceClientDefaultImpl.class.getClassLoader(),
SentryPolicyServiceClientDefaultImpl.class.getInterfaces(),
new PoolClientInvocationHandler(conf)); // new instance
{code}
This creates a new pool for each connection which doesn't make any sense - the
whole purpose is to have a pool of connections shared between calls.
> Provide pooled client connection model with HA
> ----------------------------------------------
>
> Key: SENTRY-1580
> URL: https://issues.apache.org/jira/browse/SENTRY-1580
> Project: Sentry
> Issue Type: Sub-task
> Components: Sentry
> Affects Versions: sentry-ha-redesign
> Reporter: Alexander Kolbasov
> Assignee: Alexander Kolbasov
> Priority: Critical
> Fix For: sentry-ha-redesign
>
> Attachments: SENTRY-1580.001-sentry-ha-redesign.patch,
> SENTRY-1580.002-sentry-ha-redesign.patch
>
>
> SENTRY-1477 provided a simple connection retry model which is incompatible
> with the object pool. I think that we can combine the pool model in case of
> multiple connections by using GenericKeyedObjectPool using server address as
> a key. When we suspect a disconnect we can clear the whole sub-pool using
> clear(key).
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)