Skip to content

Retry validation in more cases#114

Merged
RogerPodacter merged 2 commits into
evm-backend-demofrom
retry_validation
Sep 25, 2025
Merged

Retry validation in more cases#114
RogerPodacter merged 2 commits into
evm-backend-demofrom
retry_validation

Conversation

@RogerPodacter

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StandardError instead 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

Copilot AI Sep 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
attempts: ENV.fetch('VALIDATION_TRANSIENT_RETRIES', 1000).to_i
attempts: ENV.fetch('VALIDATION_TRANSIENT_RETRIES', 10).to_i

Copilot uses AI. Check for mistakes.
cursor[bot]

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lib/block_validator.rb
attr_reader :errors, :stats

# Exception for transient errors that should trigger retries
# This is informational - all exceptions are treated as transient

Copilot AI Sep 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@RogerPodacter RogerPodacter merged commit c44d362 into evm-backend-demo Sep 25, 2025
3 checks passed
@RogerPodacter RogerPodacter deleted the retry_validation branch September 25, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants