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

Sidecar Placement Address should be optional #6

Closed
badgeratu opened this issue Jun 2, 2021 · 2 comments · Fixed by #17
Closed

Sidecar Placement Address should be optional #6

badgeratu opened this issue Jun 2, 2021 · 2 comments · Fixed by #17
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on
Milestone

Comments

@badgeratu
Copy link
Contributor

badgeratu commented Jun 2, 2021

Expected Behavior

The --placement-host-address parameter should not be passed to the Dapr Sidecar by default unless specifically instructed.

Actual Behavior

As of Dapr 1.2 when the CLI dapr.exe launches daprd.exe it adds a default placement service address:

daprd ... --placement-host-address 127.0.0.1:6050 ...

Normally placement would be running in a local development environment in a container exposing that port (or 50005 on non-Windows) but if a service doesn't need placement/actor support it should be possible to disable this as at present the sidecar continually gives DBG log warnings about being unable to connect:

12:12:16.857 [DBG] [Man.Dapr.Sidekick.DaprSidecarHost]  try to connect to placement service: 127.0.0.1:6050
12:12:16.862 [DBG] [Man.Dapr.Sidekick.DaprSidecarHost]  error connecting to placement service: rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: tls: first record does not look like a TLS handshake"

As Sidekick is invoking daprd.exe directly, it would be useful if Sidekick had a configuration option to override this so it could prevent the --placement-host-address being specified entirely, which would result in a single warning-level log message on startup which might be preferable:

time="2021-06-02T12:48:36.2391259+01:00" level=warning msg="failed to init actors: actors: couldn't connect to placement service: address is empty" app_id=dapr-gateway instance=LONL20439 scope=dapr.runtime type=log ver=1.2.0

Note also that setting the existing DaprSidecarOptions.PlacementHostAdress to an empty string does not currently prevent the default address being passed to daprd.exe.

Steps to Reproduce the Problem

  1. Make sure Dapr is fully initialized locally (i.e. dapr init)
  2. Add Dapr Sidekick to a new ASP.NET Core Web API project
  3. Set the default Microsoft log level to Debug
  4. Make sure the default placement service container is not running
  5. Run the project in Console mode - the log messages above will be displayed.

RELEASE NOTE:

FIX: Do not assign a default placement-host-address to Sidecar

@badgeratu badgeratu added the enhancement New feature or request label Jul 23, 2021
@badgeratu badgeratu added this to the v1.1 milestone Jul 23, 2021
@badgeratu badgeratu self-assigned this Jul 28, 2021
@badgeratu badgeratu added the wontfix This will not be worked on label Jul 28, 2021
@badgeratu
Copy link
Contributor Author

Actually I don't think we will need this. The warning log messages are currently just DBG level, and the check for local placement service is very fast so doesn't seem to have any impact.

@badgeratu badgeratu reopened this Jul 30, 2021
@badgeratu
Copy link
Contributor Author

This does actually cause a problem with Dapr 1.3 when Sidekick is tarted the same host that a placement service is running as a member of a multi-node cluster, and that node is not the elected leader. Therefore we do need to be able to optionally disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant