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 · 0 comments
Labels
kind/enhancement New feature or request

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant