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 behaviour with SDS / CDS APIs #431

Closed
timperrett opened this issue Feb 6, 2017 · 2 comments
Closed

Unexpected behaviour with SDS / CDS APIs #431

timperrett opened this issue Feb 6, 2017 · 2 comments

Comments

@timperrett
Copy link
Contributor

Hi gang,

I think there may be a few separate issues with the CDS API.

Overly frequent calling of SDS/CDS

The period timer in which Envoy is calling the CDS endpoint seems to be off by an order of magnitude. Given the following config:

"cluster_manager": {
    "sds": {
      "cluster": {
        "name": "sds",
        "connect_timeout_ms": 250,
        "type": "strict_dns",
        "lb_type": "round_robin",
        "hosts": [
          {
            "url": "tcp://localhost:4000"
          }
        ]
      },
      "refresh_delay_ms": 30000
    },
    "cds": {
      "cluster": {
        "name": "cds",
        "connect_timeout_ms": 250,
        "type": "strict_dns",
        "lb_type": "round_robin",
        "hosts": [
          {
            "url": "tcp://localhost:4000"
          }
        ]
      },
      "refresh_delay_ms": 30000
    },
    "clusters": [ ]
  }

This should be 30 seconds between calls, but in the log (I have a local testing harness now to test the CDS/SDS stuff and our custom backend providing the contract Envoy needs):

2017/02/06 03:49:48 GET	/v1/clusters/service1/172.17.0.2	988.023µs
2017/02/06 03:49:49 GET	/v1/registration/consul	812.934µs
2017/02/06 03:50:23 GET	/v1/registration/consul	1.580317ms
2017/02/06 03:50:46 GET	/v1/clusters/service1/172.17.0.2	1.218456ms
2017/02/06 03:51:00 GET	/v1/registration/consul	1.185353ms
2017/02/06 03:51:32 GET	/v1/clusters/service1/172.17.0.2	1.422009ms
2017/02/06 03:51:52 GET	/v1/registration/consul	1.386849ms

Envoy appears to be calling these APIs rather frequently - perhaps something is miss configured?

Appending not replacing clusters internally?

  1. Perhaps i'm missing reading the output, but when looking locally at the Envoy (asking for /clusters, i'm not sure if the internal state of SDS/CDS is accurate as there are many duplicates. I've posted the output here: https://gist.github.com/timperrett/773c9c707b54077533ecf7144058cba1 - this to me at least looks as though the same cluster is in memory multiple times. My anticipation would be that there was only a single backend entry.

Thanks for your time. Happy to answer any questions on Gitter if this was not sufficient information.

@timperrett timperrett changed the title Issues with CDS Unexpected behaviour with SDS / CDS APIs Feb 6, 2017
@mattklein123
Copy link
Member

@timperrett regarding (1), unless I'm reading it incorrectly, that looks correct to me. The APIs are being called anywhere from 30-60s apart (expected w/ jitter).

regarding (2), that seems incorrect. Let's talk about it in Gitter.

@timperrett
Copy link
Contributor Author

For anyone reading this after the fact:

  1. This issue can be explained by the fact that the jitter added to to the SDS and CDS calls is 0-basetime where (in my example) basetime is 30 seconds. The reason two of the calls appear close together is that the random jitter for that iteration was randomly decided to be near-zero.

  2. Turns out that this part is a legitimate issue, and rears its head when running inside a docker container with bridged networking (note that --net=host does not have this issue), and that it is caused by Envoy not currently de-duplicating the hosts. See dns: de-dup returned entries #433 for more information on that.

rshriram pushed a commit to rshriram/envoy that referenced this issue Oct 30, 2018
…ilter. (envoyproxy#431)

Automatic merge from submit-queue.

Don't send attributes destination.ip and destination.port from HTTP filter.

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
```
PiotrSikora pushed a commit to PiotrSikora/envoy that referenced this issue Mar 3, 2020
fd_read: Always returns ENOSYS
fd_fdstat_get: Returns a reasonable response for fds 0 and 1,
  and EBADF otherwise.

Add a "WASI" test configuration to the existing tests that checks
for proper implementation of these by testing "fprintf,"
"fread," and "isatty".

Fixes envoyproxy/envoy-wasm#425

Signed-off-by: Gregory Brail <gregbrail@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
jplevyak pushed a commit to jplevyak/envoy that referenced this issue Apr 13, 2020
fd_read: Always returns ENOSYS
fd_fdstat_get: Returns a reasonable response for fds 0 and 1,
  and EBADF otherwise.

Add a "WASI" test configuration to the existing tests that checks
for proper implementation of these by testing "fprintf,"
"fread," and "isatty".

Fixes envoyproxy/envoy-wasm#425

Signed-off-by: Gregory Brail <gregbrail@google.com>
wolfguoliang pushed a commit to wolfguoliang/envoy that referenced this issue Jan 23, 2021
jpsim pushed a commit that referenced this issue Nov 28, 2022
This adds a new `EnvoyMobile.podspec` (unfortunately, "Envoy" is already taken). On `pod install` Cocoapods will download the latest prebuilt framework at /releases unless a specific version is defined in the Podfile.

Once this is merged, we'll need to publish our podspec to the Cocoapods trunk. Moving forward, we'll also need to update the version listed in the podspec during the release process.

Description: Adds Cocoapods support for distributing the prebuilt Envoy.framework
Risk Level: Low
Testing: Clone the [test project](https://github.com/cwalo/EnvoyTest) and with this branch checked out locally, run `pod install`. Be sure the two repos sit in the same parent directory (or update the podspec path in the Podfile).
Docs Changes: Yes
Release Notes: No
Fixes: [#125](envoyproxy/envoy-mobile#125)

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this issue Nov 28, 2022
Description: fixing some formatting issues from #431
Risk Level: low

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this issue Nov 29, 2022
This adds a new `EnvoyMobile.podspec` (unfortunately, "Envoy" is already taken). On `pod install` Cocoapods will download the latest prebuilt framework at /releases unless a specific version is defined in the Podfile.

Once this is merged, we'll need to publish our podspec to the Cocoapods trunk. Moving forward, we'll also need to update the version listed in the podspec during the release process.

Description: Adds Cocoapods support for distributing the prebuilt Envoy.framework
Risk Level: Low
Testing: Clone the [test project](https://github.com/cwalo/EnvoyTest) and with this branch checked out locally, run `pod install`. Be sure the two repos sit in the same parent directory (or update the podspec path in the Podfile).
Docs Changes: Yes
Release Notes: No
Fixes: [#125](envoyproxy/envoy-mobile#125)

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this issue Nov 29, 2022
Description: fixing some formatting issues from #431
Risk Level: low

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
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

2 participants