Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-7377 RPCs to non-members throw spurious TimeoutException #4784

Merged

Conversation

danberindei
Copy link
Member

@danberindei danberindei commented Jan 22, 2017

… members

https://issues.jboss.org/browse/ISPN-7377

MessageDispatcher.cast() removes missing members from the destinations list

@danberindei danberindei changed the title Fix TimeoutException with SYNC_IGNORE_LEAVERS when recipients are not… ISPN-7051 Fix TimeoutException with SYNC_IGNORE_LEAVERS when recipients are not… Jan 23, 2017
@danberindei danberindei force-pushed the ISPN-7051_suspected_rpcexception branch from dee6d29 to a04bdc1 Compare January 23, 2017 08:59
@danberindei danberindei changed the title ISPN-7051 Fix TimeoutException with SYNC_IGNORE_LEAVERS when recipients are not… ISPN-7377 RPCs to non-members throw spurious TimeoutException Jan 23, 2017
if (rsp.wasReceived() || rsp.wasSuspected() || rsp.wasUnreachable()) {
responses.set(i, rsp);
public Responses(Collection<Address> dests, RspList<Response> results) {
if (dests != null && dests.size() < results.size()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand when this happens: is dest strict subset of addresses in results? Does this mean that there is a result from node we have not sent the message to? On the other hand, it seems that an address from dests could be missing in results so I don't understand why are you comparing the size of the sets this way...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the condition should have been the other way around, and that's why the fix didn't really work.

@rvansa
Copy link
Member

rvansa commented Jan 23, 2017

Is it possible to add an unit test?

@danberindei danberindei force-pushed the ISPN-7051_suspected_rpcexception branch 2 times, most recently from d7916f2 to ee9ce6c Compare January 23, 2017 10:24
@danberindei
Copy link
Member Author

I fixed the comparison and added a test.

@rvansa
Copy link
Member

rvansa commented Jan 23, 2017

@danberindei Okay, looks better :) However, I would rather like to see this as a fix to JGroups than a workaround like this. Or, even better, we could get rid of the RspList completely, as this is quite heavy allocation-wise (it's a HashMap), pushing Responses to JGroups. There are quite a few translations from JGroups APIs to different sorts of maps for each request.

@danberindei danberindei force-pushed the ISPN-7051_suspected_rpcexception branch 2 times, most recently from cc9cce6 to a8c9406 Compare January 23, 2017 15:20
@belaban
Copy link
Member

belaban commented Jan 23, 2017

I've been thinking about changing this to use a more reactive pattern like onNext() for each response, terminated by onCompletion() / onError().
However, this is an API change and I don't want to introduce this so late in the game. Besides, Infinispan will move from MessageDispatcher to JChannel and therefore this is (or will be) moot.

@rvansa
Copy link
Member

rvansa commented Jan 23, 2017

@danberindei How do we remember to remove this burden once Infinispan stops using MD, then?

@danberindei
Copy link
Member Author

@rvansa If we stop using MD then we automatically stop using RspList as well, we'll keep only the HashMap in Responses :)

I've already started working on this, and for now I'm still using Rsp, but I completely replaced RspList with Responses. Before I open the PR I intend to remove the usage of Rsp as well. I have also considered changing the API, but I'm not convinced about using lambdas for this.

@belaban Still, @rvansa is right, it would be better if we didn't need this workaround, and MessageDispatcher.cast() created a Rsp instance for each recipient when the collection of addresses is not null.

@danberindei danberindei force-pushed the ISPN-7051_suspected_rpcexception branch from a8c9406 to 815730d Compare January 25, 2017 15:12
@belaban
Copy link
Member

belaban commented Jan 25, 2017

Not sure I follow... why do you still need Rsp or Responses (from JGroups?) if you use the channel directly?

@danberindei
Copy link
Member Author

@belaban Responses is our own class, but for some reason @rvansa wants to push it to JGroups ;)
I'm still using Rsp at the current stage of the migration to JChannel, but I'm removing those usages soon.

@rvansa
Copy link
Member

rvansa commented Jan 26, 2017

@danberindei I don't want to push it into JGroups if that wouldn't be of use; I want to avoid RspList -> Responses transformations.

@danberindei danberindei force-pushed the ISPN-7051_suspected_rpcexception branch 3 times, most recently from fb6f838 to 5561c3a Compare February 3, 2017 08:42
@galderz
Copy link
Member

galderz commented Feb 3, 2017

So, what's the conclusion to this?

@danberindei
Copy link
Member Author

I think it's ready to go in, and we'll resume the Responses discussion when I finish https://issues.jboss.org/browse/ISPN-6971 :)

@danberindei danberindei force-pushed the ISPN-7051_suspected_rpcexception branch from 5561c3a to ea16b05 Compare February 13, 2017 13:28
MessageDispatcher.cast() removes missing members from the destinations list
@danberindei danberindei force-pushed the ISPN-7051_suspected_rpcexception branch from ea16b05 to dbb362e Compare February 14, 2017 11:12
@slaskawi slaskawi merged commit eecec24 into infinispan:master Feb 15, 2017
@slaskawi
Copy link
Contributor

Integrated thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants