Skip to content

Commit 63e4202

Browse files
gabynevadaclaude
authored andcommitted
fix(dapr): use WaitUntilHealthy for component dependencies
Components are long-lived configuration resources that should reach "Running" state and stay there. Using WaitForCompletion was incorrect as it expected components to reach "Completed" state. Now using WaitType.WaitUntilHealthy which properly waits for resources to be in a healthy/running state, matching the component lifecycle. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 3e6209f commit 63e4202

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Shared/Dapr/Core/DaprDistributedApplicationLifecycleHook.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public async Task BeforeStartAsync(DistributedApplicationModel appModel, Cancell
202202
// Make the Dapr CLI wait for the component resources it references
203203
foreach (var componentRef in componentReferenceAnnotations)
204204
{
205-
daprCli.Annotations.Add(new WaitAnnotation(componentRef.Component, WaitType.WaitForCompletion));
205+
daprCli.Annotations.Add(new WaitAnnotation(componentRef.Component, WaitType.WaitUntilHealthy));
206206
}
207207

208208
resource.Annotations.Add(
@@ -475,7 +475,7 @@ private static void SetupComponentLifecycle(DistributedApplicationModel appModel
475475
// This ensures the component waits for its dependencies before becoming ready
476476
foreach (var dependency in dependencies)
477477
{
478-
component.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitForCompletion));
478+
component.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitUntilHealthy));
479479
}
480480
}
481481
}

0 commit comments

Comments
 (0)