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

WaitForSidecarAsync should accept input as to which sidecar [optional?] services to wait for (with timeout) #1351

Open
oising opened this issue Sep 26, 2024 · 1 comment
Labels
area/client kind/enhancement New feature or request
Milestone

Comments

@oising
Copy link

oising commented Sep 26, 2024

Describe the feature

Example: With DAPR workflows hosted in an app that also listens to a binding or pubsub (i.e. it declares an appPort), there is a race condition between the DAPR sidecar detecting the appPort as open, and the actor runtime initializing. DAPR blocks until it detects all declared appPorts, and only initializes the actor runtime after this has completed.

Meanwhile, any app that tries to start a workflow after calling daprClient.WaitForSideAsync() -- which returns before the actor runtime is ready -- the call to ScheduleNewWorkflowAsync fails with an "actor runtime is not configured" error.

Retrying the ScheduleNewWorkflowAsync call after a few seconds generally succeeds, but it seems that WaitForSidecarAsync should not return until all declared services are truly ready.

I suggest allowing which services to wait for, along with a timeout (default timeout 30 seconds, perhaps.) I understand that the actor runtime is not a foundational service as it needs a dedicated statestore configured, but this is why we need this method parameterized.

e.g.

public async Task WaitForSidecarAsync(WaitForSidecarOptions options, CancellationToken token);

public record WaitForSidecarOptions(... RequireActorRuntime = false);

Release Note

RELEASE NOTE:

@oising oising added the kind/enhancement New feature or request label Sep 26, 2024
@WhitWaldo
Copy link
Contributor

I think there's a great opportunity to improve on how the .NET client handles readiness and liveness checks of the various sidecar services in general and it's something I'm going to be looking at in the next release, but I don't know I've got the free time this cycle.

I was reading through another open-source project that seeks to help Dapr in this respect that has a far richer "is it live" mechanism than the .NET client currently has, so I think there's definitely a need to get this into a better place.

Increasingly, we're moving to smaller, block-specific clients that would only look for the availability of those services that facilitate whatever they rely on, so I don't know that we'd necessarily need options like your suggestion, but I agree this is something useful to look at iterating on.

@WhitWaldo WhitWaldo added this to the Future milestone Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants