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

Handshake timing #55

Open
EP-u-NW opened this issue Nov 18, 2020 · 0 comments
Open

Handshake timing #55

EP-u-NW opened this issue Nov 18, 2020 · 0 comments

Comments

@EP-u-NW
Copy link
Contributor

EP-u-NW commented Nov 18, 2020

Due to bad timing it can happen that the Welcome Message from the Core is never received on the Adapter.
During the handshake, a hello message is send from the adapter to the core, containing an address where the core should deliver the welcome message to ("welcome topic"). Prior to sending this hello message, the adapter also issues a subsciption to the welcome topic.
While tcp guarantees that messages arrive in order, the welcome topic subscription and hello message are subject to different tcp connections, so there is no guarantee in which order they arrive, nor how they are proccessed by the cores zmq.
If the hello message is processed and answered by the core by publising the welcome message to the welcome topic before the welcome topic subscription is processed, the message is not delivered to the adapter.

Possible workadrounds are to add an adapterside delay between subscribing to the welcome topic and publishing the hello message or to disable Nagle's algorithm (setting TCP_NODELAY). Both are suboptimal since waiting is never a good idea (how long should we actually wait?) and disabeling Nagle can spam the network with loads of small tcp packages, creating a massiv overhead.

A suggested coreside fix is using the SubscriptionTracker, to wait until there are subscribers on the welcome topic before publising to it.

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

No branches or pull requests

0 participants