dashersw / dashersw/cote

Round-robin mechanism leads to lost requests

Open
#240 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.4k
Forks
184
PR merge metrics
No merged PRs in 30d

Description

Hello @dashersw

I'm building a project with multiple requesters and responders.

All responders in my system are not able to answer all the topics. For example:
- "responder1" is able to respond to "topic1" and "topic2"
- "responder2" is able to respond to "topic2" and "topic3"
- "requester1" requests "topic1"
- "requester2" requests "topic2"
- "requester3" requests "topic3"

Requesters and responders advertisement fields "requests" and "respondsTo" are filled accordingly.

I notice the following issue:
- all requesters connects to all responders (OK, this is the actual wanted purpose I think)
- when "requester1" sends a requests "topic1", because of the round-robin mechanism used, the requests is done sometimes to "responder1" and the response is received (OK) and sometimes to "responder2" which is not aware of the "topic1" and do not respond at all (KO).

=> When a request is sent by a requester, the selected responder sock should be checked to verify the responder is able to answer to the wanted topic, by checking advertisement "respondsTo" array.

Additionally, to avoid unused connections, I think it is better to match advertisement "requests" and "respondsTo" arrays when a node is discovered. In my example above, "requester1" do not need to connect to "responder2". Not verified at this moment, but probably the same remark can be done for pub/sub instances.

Actually I'm trying to make a patch and I can propose a Pull Request if it is working.

Joel

EDIT: I have seen https://github.com/dashersw/cote/issues/165 about the subset mechanism, but it's a pitty to have subset=respondsTo...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.