Resilience Analyzers
Resilience Analyzers
Resilience analyzers protect against incomplete error handling configuration that can cause silent failures, where error recovery appears to succeed but silently fails at runtime.
NP9001: Incomplete Resilient Configuration
ID: NP9001
Severity: Warning
Category: Resilience
This analyzer detects when an error handler can return PipelineErrorDecision.RestartNode but is missing one or more of the three mandatory prerequisites for node restart functionality.
The Problem
Without using this analyzer, developers can easily miss one of the three mandatory prerequisites for node restart, leading to silent failures where the entire pipeline would crash instead of recovering the failed node.
With the Analyzer
CSC : error NP9001: Error handler can return PipelineErrorDecision.RestartNode
but the node may not have all three mandatory prerequisites configured...
This gets flagged immediately at build time, during development, preventing the build from succeeding.
Solution: Complete Configuration
For detailed step-by-step configuration instructions, see the Getting Started with Resilience guide.
The three mandatory prerequisites are:
- ResilientExecutionStrategy wrapping the node
- MaxNodeRestartAttempts > 0 in PipelineRetryOptions
- MaxMaterializedItems != null in PipelineRetryOptions (bounded materialization)
Missing even one of these prerequisites will silently disable restart, causing the entire pipeline to fail instead of recovering gracefully.
Best Practices
- Always configure all three prerequisites together - They work as a unit
- Use ResilientExecutionStrategy consistently - Apply it to all nodes that need restart capability
- Set realistic MaxNodeRestartAttempts - Usually 2-3 attempts is sufficient
- Configure MaxMaterializedItems appropriately - Balance memory usage with retry capability
Critical Warning: Never set MaxMaterializedItems to null (unbounded). This silently disables restart functionality and can cause OutOfMemoryException. See the Getting Started with Resilience guide for detailed explanation of why unbounded buffers break resilience guarantees.
See Also
- Getting Started with Resilience - Complete step-by-step configuration guide
- Resilience Configuration Guide
- Error Handling Architecture
- Cancellation Model