Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Subscription following port clash is successful but never connects #1830

@hmendesB2C2

Description

@hmendesB2C2

We have come across the following scenario with a Java Media Driver and Aeron 1.48.3:

  1. App requests Aeron to establish a subscription and to bind it to local port 35001, in a channel like aeron:udp?endpoint=0.0.0.0:35001|control=controlHost:9055|control-mode=dynamic (the issue also occurs on non-MDC channel aeron:udp?endpoint=0.0.0.0:35001)
  2. The media driver fails to establish the subscription because port 35001 is already taken. This results in a RegistrationException to the caller adding the subscription
  3. After a few seconds we ask Aeron again to subscribe to the same channel and it succeeds, but then this subscription never connects with the publisher. subscription.isConnected() is always false.

Some observations:

  • Actually this retry subscription should have failed with the same Exception because the port clash wasn't removed.
  • I have tried removing the port clash before the retry and nothing changes, the subscription is successful but never connects.
  • Actually if we log the local endpoint (subscription.resolvedEndpoint()) of this "succeeded" subscription, it come as null, and the channelStatus is a positive long (43) that isn't a meaningful value, so something obviously is wrong.

I did debug through the media driver when these interactions are occurring:

  • When the media driver failed the first time it didn't remove the channel subscription from some of it's internal maps (receiveChannelEndpointByChannelMap in DriverConductor) despite everything for that subscription being closed.
  • When the subsequent subscription is attempted the media driver associates the subscription with the old failed one but in this case just returns a successful Subscription object associated with a broken socket and so on, which never connects.

From a practical point of view what does this mean:
Once an app faces a subscription local port clash it's doomed regarding that channel. Even restarting the app doesn't make the media driver reattempt establishing the socket. The only way for the subscription socket to be reattempted is to restart the media driver such that it forgets about that subscription. This is obviously not great if a media driver is being shared across several apps.

Is this Aeron behaviour by design or is it an issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions