curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CURATOR-271) Curator does not run sync callback on supplied Executor
Date Tue, 13 Oct 2015 22:22:05 GMT

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

ASF GitHub Bot commented on CURATOR-271:
----------------------------------------

GitHub user wallaceg-tp opened a pull request:

    https://github.com/apache/curator/pull/114

    [CURATOR-271] Curator does not run sync callback on supplied Executor

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/wallaceg-tp/curator CURATOR-271

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/114.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #114
    
----
commit a14b277b97a8e94cdd8820c2b0da50430bb1b5d1
Author: Glen Wallace <glen.wallace@transpower.co.nz>
Date:   2015-10-13T22:00:04Z

    Use supplied executor

----


> Curator does not run sync callback on supplied Executor
> -------------------------------------------------------
>
>                 Key: CURATOR-271
>                 URL: https://issues.apache.org/jira/browse/CURATOR-271
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Framework
>            Reporter: Glen Wallace
>            Assignee: Cameron McKenzie
>
> It appears that Apache Curator does not execute the sync callback on the supplied Executor
in at least one case.
> This issue described is currently (2015-10-14) present in master
> Sample code outline:
> {code:java}
> BackgroundCallback myCallback = ...;
> Executor myExecutor = ...;
> String myZkPath = ...;
> CuratorFramework myCurator = ...;
> curator.sync()
>   .inBackground(myCallback, myExecutor)
>   .forPath(myZkPath);
> {code}
> This should execute {{myCallback}} on the {{myExecutor}} executor, it does not and instead
executes {{myCallback}} on what is presumeably a ZooKeeper thread.
> Looking at the {{org.apache.curator.framework.imps.SyncBuilderImpl}} code we have
> {code:java}
> public Pathable inBackground(BackgroundCallback callback, Executor executor) {
>   backgrounding = new Backgrounding(callback, executor);
>   return this;
> }
> {code}
> However the only matching constructor in {{org.apache.curator.framework.imps.Backgrounding}}
is {{Backgrounding(BackgroundCallback callback, Object context)}}
> It seems that {{SyncBuilderImpl#inBackground(BackgroundCallback,Executor)}} should be
using the following Backgrounding constructor {{Backgrounding(CuratorFrameworkImpl, BackgroundCallback,
Executor)}}
> A workaround looks to be using the following method and passing a null context object:
> {code:java}
>   public Pathable inBackground(BackgroundCallback callback, Object context, Executor
executor)
> {code}
> A very quick skim suggests that it is only {{SyncBuilderImpl}} that has the issue the
other {{org.apache.curator.framework.imps.*BuilderImpl}} classes seem to be fine.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message