[
https://issues.apache.org/jira/browse/IGNITE-15196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexander Lapin updated IGNITE-15196:
-------------------------------------
Summary: Null seems to be an unexpected result for
ScaleCubeMessagingService#invoke() on node stopping (was: Null seems to be an
inexpected result for ScaleCubeMessagingService#invoke() on node stopping)
> Null seems to be an unexpected result for ScaleCubeMessagingService#invoke()
> on node stopping
> ----------------------------------------------------------------------------------------------
>
> Key: IGNITE-15196
> URL: https://issues.apache.org/jira/browse/IGNITE-15196
> Project: Ignite
> Issue Type: Bug
> Reporter: Alexander Lapin
> Priority: Major
> Labels: ignite-3
>
> In case of node stop it's possible to get null as a result of an invoke
> operation.
>
> {code:java}
> return cluster
> .requestResponse(fromNetworkAddress(addr), message)
> .timeout(Duration.ofMillis(timeout))
> .toFuture()
> .thenApply(m -> m == null ? null : m.data()); // The result can be null
> on node stopping.
> {code}
> It's a rather confusing behavior that produces NPE. See
> [IGNITE-15195|https://issues.apache.org/jira/browse/IGNITE-15195] for more
> details. In order not not fail with NPE I've updated null handling in a
> following way
> {code:java}
> return cluster
> .requestResponse(fromNetworkAddress(addr), message)
> .timeout(Duration.ofMillis(timeout))
> .toFuture()
> .thenApply(m -> {
> if (m == null)
> throw new CompletionException(new NodeStoppingCheckedException());
> else
> return m.data();
> }); // The result can be null on node stopping.{code}
> within [IGNITE-15148|https://issues.apache.org/jira/browse/IGNITE-15148]
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)