Retry validation in more cases#114
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR changes the retry strategy for validation operations from selectively retrying only specific transient errors to retrying all exceptions, treating any failure to validate as a potential infrastructure issue rather than a definitive validation failure.
Key changes:
- Treat all RPC/API exceptions as transient rather than distinguishing between error types
- Simplify error handling by removing the
transient_error?classification method - Update retry configuration to use
StandardErrorinstead of specific exception types
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/storage_reader.rb | Separates nil results (RPC failures) from empty results (legitimate not-found) with clearer error messages |
| lib/block_validator.rb | Removes selective error classification and treats all exceptions as transient validation errors |
| app/models/validation_result.rb | Removes exception handling wrapper, letting all errors propagate to the job level |
| app/jobs/validation_job.rb | Changes retry strategy from specific TransientValidationError to all StandardError exceptions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| retry_on StandardError, | ||
| wait: ENV.fetch('VALIDATION_RETRY_WAIT_SECONDS', 5).to_i.seconds, | ||
| attempts: ENV.fetch('VALIDATION_TRANSIENT_RETRIES', 5).to_i | ||
| attempts: ENV.fetch('VALIDATION_TRANSIENT_RETRIES', 1000).to_i |
There was a problem hiding this comment.
The default retry count of 1000 attempts seems excessive and could lead to jobs running indefinitely in case of persistent issues. Consider a more reasonable default like 10-20 attempts to prevent resource exhaustion while still providing adequate retry coverage for transient failures.
| attempts: ENV.fetch('VALIDATION_TRANSIENT_RETRIES', 1000).to_i | |
| attempts: ENV.fetch('VALIDATION_TRANSIENT_RETRIES', 10).to_i |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| attr_reader :errors, :stats | ||
|
|
||
| # Exception for transient errors that should trigger retries | ||
| # This is informational - all exceptions are treated as transient |
There was a problem hiding this comment.
Since all exceptions are now treated as transient, the TransientValidationError class appears to be unused. Consider removing this class and its comment to avoid confusion about its purpose.
No description provided.