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

rlinks: potential loop in invocation forwarding code #1894

Open
om26er opened this issue Oct 7, 2021 · 3 comments
Open

rlinks: potential loop in invocation forwarding code #1894

om26er opened this issue Oct 7, 2021 · 3 comments

Comments

@om26er
Copy link
Contributor

om26er commented Oct 7, 2021

Imagine two Crossbar instances

  • Instance 1 connects to instance 2 using rlinks with forward_local_invocations and forward_remote_invocations set to true.
  • Instance 1 registers procedure foo.bar.1 and instance 2 registers foo.bar.2 on their ends
  • Since both RLinkLocalSession and RLinkRemoteSession are subscribed to wamp.subscription.on_create, when instance 1 successfully registers procedure foo.bar.2 due to the rlink connection, it gets an event wamp.subscription.on_create on the local leg, so it then tries to re-register the procedure on the remote leg.

Exception gets raised here and since there is no error handling here, bad things happen

reg = yield other.register(on_call,

@om26er
Copy link
Contributor Author

om26er commented Oct 7, 2021

This probably applies to event forwarding code as well.

@oberstet
Copy link
Contributor

In general, breaking loops is supposed to work using forward_for

self.forward_for = forward_for

This WAMP message item collects all node IDs of router nodes a message has traveled when crossing rlinks. And this field can then be used to filter looped back messages.

Now, there will be errors left in the code. I guess we need some CI test approach where we can add specific test scenarios, including the topology between nodes and their config, to robustly fix such issues robustly and prevent them to reappear ...

@om26er om26er self-assigned this Nov 20, 2021
@om26er om26er mentioned this issue Nov 22, 2021
@oberstet
Copy link
Contributor

partial fix merged via #1913

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

No branches or pull requests

2 participants