Skip to content

Delay Dapr Sidecar startup till project has started #1292

@amiller-attekus

Description

@amiller-attekus

Related to an existing integration?

Yes

Existing integration

Dapr

Overview

Currently the DaprSidecar will start when all waitFor operations such as Redis have been fullfilled, however there is currently no way to WaitFor the application startup of the Sidecar that it is attached to.

The DaprSidecar start immediately without waiting for the application startup. I sometimes have to restart the Dapr Sidecar as it fails to connect to the Application instance.

Usage example

Project definition:

var cache = builder.AddRedis("redis");

var project = builder.AddProject<Projects.My_Api("my-api")
  .WaitFor(cache)
 .WithReference(cache)
.WithDaprSidecar(sidecar => {
  sidecar
    .WithOptions(new DaprSidecarOptions() { AppId = "MyApi" });
});

The sidecar does not waitFor application startup.

Also tried, but this doesn't work either:

var cache = builder.AddRedis("redis");

var project = builder.AddProject<Projects.My_Api("my-api")
  .WaitFor(cache)
 .WithReference(cache);

project.WithDaprSidecar(sidecar => {
  sidecar
    .WithOptions(new DaprSidecarOptions() { AppId = "MyApi" })
    .WaitFor(project)
});

Breaking change?

No

Alternatives

The reference to the application is available, so would be good for the DaprSidecar to respect the startup of the referenced project.

Additional context

I also will choose explicitly starting some applications, so would like the DaprSidecar not to start automatically but rather waitFor the project to start.

Help us help you

No, just wanted to propose this

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions