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

Unexpected "Mismatched Endpoint or Control" Exception with tagged MDC subscriptions #1714

Closed
mgeri opened this issue Jan 14, 2025 · 3 comments

Comments

@mgeri
Copy link

mgeri commented Jan 14, 2025

Hi, we encounter an unexpected exception when using tagged MDC subscriptions with Java Aeron 1.44.3.

Below is the scenario that leads to the issue.

  1. A channel is defined as:
    aeron:udp?control-mode=dynamic|tags=22071|control=my-service:22071|term-length=512k|fc=min|endpoint=192.168.1.10:0
    
  2. Initially, my-service resolves to the address 192.168.1.20, but this node is currently unavailable.
  3. An application running on 192.168.1.10 starts and opens an MDC subscription. The subscription waits for the publisher.
  4. The publisher, initially bound to 192.168.1.20 , restarts on 192.168.1.30, updating the resolution of my-service name to 192.168.1.30.
  5. The original subscription waiting for the publisher on 192.168.1.10 successfully starts receiving data from the new publisher on 192.168.1.30.
  6. However, with the original subscript still active, when the same application attempts to start another new subscription on the same channel, the following exception is thrown:
matching tag=22071 has mismatched endpoint or control: 
aeron:udp?control-mode=dynamic|tags=22071|control=my-service:22071|term-length=512k|fc=min|endpoint=192.168.1.10:0 <> aeron:udp?control-mode=dynamic|tags=22071|control=my-service:22071|term-length=512k|fc=min|endpoint=192.168.1.10:0

This behavior is unexpected because the initial subscription is successfully connected and receives data from the publisher on 192.168.1.30.

The exception is traced to the UdpChannel.matchesTag method, specifically within its private hasMatchingAddress function.
It seems this function is checking against the old resolved control address (192.168.1.20) despite the active subscription working with the updated publisher running on 192.168.1.30.

@mikeb01
Copy link
Contributor

mikeb01 commented Jan 16, 2025

This has shown up a genuine issue and I've just merged a PR to address it.

However, I'm a little unsure about how you are creating your channels. Could you show how you are adding your publications and subscriptions and the specific channels used for each. E.g. specifying a control-mode=dynamic and an endpoint tends to be a little self defeating.

@mgeri
Copy link
Author

mgeri commented Jan 16, 2025

Michael, thank you so much for looking into this issue! 🙏😄

You’re absolutely right - this was my mistake while trying to simplify the scenario to make the issue clearer. The endpoint parameter is used only when adding subscribers, not publishers.

If you suspect other configurations might be causing issues or unintended behavior, I’d love to hear your thoughts or recommendations.

@vyazelenko
Copy link
Contributor

Fixed with #1720.

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

3 participants