Re: [jgroups-users] In which case Rsp could be null?

Questions/problems related to using JGroups <[email protected]>
Newsgroups gmane.comp.java.javagroups.general
Message-ID <CAOQmiF5uqACqXOu_vj=rJHt5+fgwg-PeRJaZMXZqU78SrBqTxA@mail.gmail.com>
I use version 3.6.7.
The cluster had 35 nodes when the error happened, but it was under heavy
load. I guess the node got out of the cluster, and was thinking it is
alone)) because this error happens periodically, often, but not always.
By design, the cluster is very chatty. Each node sends requests to every
other node if the file exists on it. So, there are 34 such RPC call was
made, and I'm guessing, none of them got respond in 5 seconds, as it is
configured.
I guess I could increase the timeout for this case, if the cluster grows.

Thank you for your quick response.
Eugene


On Wed, Apr 6, 2016 at 12:15 PM, Questions/problems related to using
JGroups <[email protected]> wrote:

> Hi Eugene
>
> MessageDispatcher.cast (which is used by
> RpcDispatcher.callRemoteMethods) will return null if
> real_dests.isEmpty(). In your case, that would happen if the cluster
> has a single member.
>
> Cheers
> Dan
>
>
> On Wed, Apr 6, 2016 at 6:32 PM, Questions/problems related to using
> JGroups <[email protected]> wrote:
> > Hello,
> >
> > I use RPC, and getting NullPointerException in very unusual place:
> >
> > Here is my code example:
> >
> > -----------------
> >
> > RspList<Boolean> result = dispatcher.callRemoteMethods(null,
> "fileExists",
> > new Object[] { localFileName }, new Class[] { String.class },
> > OPT_ALL_IN_5_SEC);
> >
> > for (Rsp<Boolean> rsp : result.values()) {
> >
> > if (rsp.getValue()) {
> >
> > -------------------
> >
> > the last line sometimes throws NPE. Looks like rsp is null.
> >
> > The fileExists method returns primitive boolean, so the result cannot be
> > null by definition.
> >
> > Looks like something went wrong during the cluster communication.
> >
> > What could it be?
> >
> >
> > Thanks,
> >
> > Eugene
> >
> >
> >
> ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > javagroups-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/javagroups-users
> >
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> javagroups-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/javagroups-users
>

------------------------------------------------------------------------------

_______________________________________________
javagroups-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/javagroups-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.