Repository navigation
Improve service self recovery - #6785
Merged
dkurepa merged 3 commits intoOct 21, 2026
Merged
Conversation
…token has been cancelled, add self healing to replicas
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The health check references missing consumer properties, preventing compilation.
1 open issue
What changed in this PR
Improves PCS recovery from consumer timeouts and unexpected consumer exits.
Changes:
- Keeps consumers running after cancellations unrelated to host shutdown.
- Adds consumer health checks and a restart-triggering liveness probe.
- Adds recovery tests and documents probe behavior.
| File | Description |
|---|---|
| test/Maestro/Maestro.WorkItems.Tests/WorkItemConsumerTests.cs | Tests timeout recovery and shutdown handling. |
| test/Maestro/Maestro.WorkItems.Tests/WorkItemConsumerHealthCheckTests.cs | Tests consumer health states and endpoints. |
| src/Maestro/Maestro.WorkItems/WorkItemConsumerHealthCheck.cs | Detects consumers that are no longer running. |
| src/Maestro/Maestro.WorkItems/WorkItemConsumer.cs | Limits cancellation exits to host shutdown. |
| src/Maestro/Maestro.WorkItems/WorkItemConfiguration.cs | Registers consumer liveness checks. |
| src/Maestro/Maestro.Services.Common/ServiceDefaultsExtensions.cs | Shares the liveness-check tag. |
| eng/service-templates/ProductConstructionService/container-app.bicep | Adds the periodic liveness probe. |
| docs/DevGuide.md | Documents probes and detection limits. |
Review effort: Balanced
|
|
||
| string[] stoppedConsumers = _consumers | ||
| .Where(consumer => consumer.ExecuteTask is null || consumer.ExecuteTask.IsCompleted) | ||
| .Select(consumer => $"{consumer.ConsumerId} ({consumer.QueueName})") |
premun
reviewed
Oct 21, 2026
premun
approved these changes
Oct 21, 2026
premun
enabled auto-merge (squash)
October 21, 2026 11:43
dkurepa
disabled auto-merge
October 21, 2026 11:45
dkurepa
enabled auto-merge (squash)
October 21, 2026 11:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR does two things:
WorkItemConsumerif comes from something other than the service cancellation token