ignite-issues 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] (IGNITE-5994) IgniteInternalCache.invokeAsync().get() can return null
Date Thu, 31 Aug 2017 15:00:02 GMT

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

ASF GitHub Bot commented on IGNITE-5994:
----------------------------------------

GitHub user shia86 opened a pull request:

    https://github.com/apache/ignite/pull/2569

    IGNITE-5994 Implemented.

    

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

    $ git pull https://github.com/shia86/ignite ignite-5994

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

    https://github.com/apache/ignite/pull/2569.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 #2569
    
----
commit 1472304fe29e4dabab43bccf849bc3832811638d
Author: Zhang Yuan <shia.zhang@dianping.com>
Date:   2017-08-14T03:38:25Z

    IGNITE-5994 Implemented.

----


> IgniteInternalCache.invokeAsync().get() can return null
> -------------------------------------------------------
>
>                 Key: IGNITE-5994
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5994
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 2.1
>            Reporter: Alexander Menshikov
>            Assignee: Zhang Yuan
>            Priority: Minor
>              Labels: newbie
>         Attachments: IgniteCacheSelfTest.java, master_8629b50d6f_ignite-5994.patch
>
>
> The IgniteInternalCache.invoke() always return an EntryProcessorResult, but the IgniteInternalCache.invokeAsync().get()
can return the null in case when an EntryProcessor has returned the null.
> Code from reproducer:
> {noformat}
> final EntryProcessor<Object, Object, Object> ep = new EntryProcessor<Object,
Object, Object>() {
>             @Override
>             public Object process(MutableEntry<Object, Object> entry,
>                 Object... objects) throws EntryProcessorException {
>                 return null;
>             }
>         };
>         EntryProcessorResult<Object> result = utilCache.invoke("test", ep);
>         assertNotNull(result);
>         assertNull(result.get());
>         result = utilCache.invokeAsync("test", ep).get();
>         // Assert here!!!
>         assertNotNull(result);
>         assertNull(result.get());
> {noformat}
> It can be optimization. Nevertheless results of invoke() must be equals with results
of invokeAsync().get(). So there are two options:
> 1) To do so would be the invokeAsync(key, ep).get() returned the null too for the optimization.
> 2) Or to do so would be the invoke(key, ep) returned an EntryProcessorResult for a logical
consistency.
> NOTE: Don't confuse with IgniteCache.invoke.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message