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

Services: Improved behavior when the first route to the server doesn't work #1343

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

FlorianReimold
Copy link
Member

Description

Before, the Service Client would only try the very first route to the Service Server. Now, it will go through all routes until it finds one that works.

Cherry-pick to

  • none

…t work

Before, the Service Client would only try the very first route to the Service Server. Now, it will go through all routes until it finds one that works.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@KerstinKeller
Copy link
Contributor

KerstinKeller commented Feb 2, 2024

On GH Actions, some Unit Tests are now failing:

4: [  PASSED  ] 10 tests.
4: [  FAILED  ] 1 test, listed below:
4: [  FAILED  ] ClientServer.ClientConnectEvent
4: 
4:  1 FAILED TEST
 4/14 Test  #4: test_clientserver ................***Failed   72.27 sec

It also fails locally on my machine @FlorianReimold

eCAL detects "disconnections" by a "failed re-connection". That re-connection however takes a little more time now, as we try all available routes.
Copy link
Contributor

@KerstinKeller KerstinKeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, I approve, however, I do have one question.
The test increase the timeout to 20seconds. In real life, how long does the host name resolution take and is it done synchronously or asynchonously?

@FlorianReimold
Copy link
Member Author

FlorianReimold commented Feb 5, 2024

Technically speaking, the hostname resolution is async:

I don't know how long the hostname resolution takes. I think it is "fast".

But obviously, you need to wait for the hostname resolution and the connection establishement to finish, before the service can return any response.

The reason for the high timeout is, that eCAL doesn't use the immediate callbacks from the service library

How it should be:

  • eCAL detects service server via registration layer
  • Service client resolves hostname
  • Service client connects to service server
  • ...
  • Service server is deleted
  • Service client immediately fires disconnection callback which is forwarded to the user

How I think it is implemented:

  • eCAL detects service server via registration layer
  • Service client resolves hostname
  • Service client connects to service server
  • ...
  • Service server is deleted
  • Service client fires disconnection callback, but this is not used
  • ...
  • eCAL runs registration layer and detects that the server is gone
  • eCAL tries to reconnect the client to the server anyways (I didn't debug it, only looked at the logs. But for some reason this seems to happen)
  • Service client resolves the hostname
  • Service client connects to non existing service server (fails)
  • eCAL fires a custom disconnection callback

@FlorianReimold FlorianReimold merged commit 3f103b0 into master Feb 5, 2024
14 checks passed
@FlorianReimold FlorianReimold deleted the hotfix/service_try_all_routes branch February 13, 2024 10:36
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

Successfully merging this pull request may close these issues.

2 participants