Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2214A10E86 for ; Tue, 1 Sep 2015 01:37:46 +0000 (UTC) Received: (qmail 24492 invoked by uid 500); 1 Sep 2015 01:37:46 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 24439 invoked by uid 500); 1 Sep 2015 01:37:46 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 24426 invoked by uid 99); 1 Sep 2015 01:37:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2015 01:37:45 +0000 Date: Tue, 1 Sep 2015 01:37:45 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-247) Extend Curator's connection state to support SESSION_LOST MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CURATOR-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14724553#comment-14724553 ] ASF GitHub Bot commented on CURATOR-247: ---------------------------------------- Github user cammckenzie commented on a diff in the pull request: https://github.com/apache/curator/pull/97#discussion_r38378657 --- Diff: curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java --- @@ -103,23 +106,34 @@ public CuratorFrameworkImpl(CuratorFrameworkFactory.Builder builder) { ZookeeperFactory localZookeeperFactory = makeZookeeperFactory(builder.getZookeeperFactory()); - this.client = new CuratorZookeeperClient(localZookeeperFactory, builder.getEnsembleProvider(), builder.getSessionTimeoutMs(), builder.getConnectionTimeoutMs(), new Watcher() - { - @Override - public void process(WatchedEvent watchedEvent) - { - CuratorEvent event = new CuratorEventImpl(CuratorFrameworkImpl.this, CuratorEventType.WATCHED, watchedEvent.getState().getIntValue(), unfixForNamespace(watchedEvent.getPath()), null, null, null, null, null, watchedEvent, null, null); - processEvent(event); - } - }, builder.getRetryPolicy(), builder.canBeReadOnly()); + this.client = new CuratorZookeeperClient + ( + localZookeeperFactory, + builder.getEnsembleProvider(), + builder.getSessionTimeoutMs(), + builder.getConnectionTimeoutMs(), + new Watcher() + { + @Override + public void process(WatchedEvent watchedEvent) + { + CuratorEvent event = new CuratorEventImpl(CuratorFrameworkImpl.this, CuratorEventType.WATCHED, watchedEvent.getState().getIntValue(), unfixForNamespace(watchedEvent.getPath()), null, null, null, null, null, watchedEvent, null, null); + processEvent(event); + } + }, + builder.getRetryPolicy(), + builder.canBeReadOnly(), + builder.getConnectionHandlingPolicy() + ); + internalConnectionHandler = builder.getConnectionHandlingPolicy().isEmulatingClassicHandling() ? new ClassicInternalConnectionHandler() : new StandardInternalConnectionHandler(); --- End diff -- Is there a reason that this needs to be a separate instance rather than just a reference to the connection handler from the builder? > Extend Curator's connection state to support SESSION_LOST > --------------------------------------------------------- > > Key: CURATOR-247 > URL: https://issues.apache.org/jira/browse/CURATOR-247 > Project: Apache Curator > Issue Type: Sub-task > Components: Framework > Affects Versions: 2.8.0 > Reporter: Jordan Zimmerman > Assignee: Jordan Zimmerman > Fix For: 3.0.0 > > > Currently, Curator has a connection state for LOST that confuses users. It does _not_ mean that the session is lost. Instead it means that the retry policy has given up retrying. Introduce a new connection state that roughly corresponds to the ZooKeeper session expiring. Possibly require that clients request this support via a new new builder method in CuratorFrameworkFactory -- This message was sent by Atlassian JIRA (v6.3.4#6332)