Skip to content

[progenitor-client] add Error::is_retryable#1308

Merged
sunshowers merged 2 commits intomainfrom
sunshowers/spr/progenitor-client-add-erroris_retryable
Feb 12, 2026
Merged

[progenitor-client] add Error::is_retryable#1308
sunshowers merged 2 commits intomainfrom
sunshowers/spr/progenitor-client-add-erroris_retryable

Conversation

@sunshowers
Copy link
Contributor

Note this check is somewhat broader than the one currently in Omicron. That one only checks for 503 and 429, while the check here is a bit more complete based on HTTP semantics:

  • 429, 502, 503, 504
  • against all variants that carry a status

Created using spr 1.3.6-beta.1
@sunshowers sunshowers requested a review from ahl February 11, 2026 01:44
}
}

/// Returns `true` if this error is likely transient and the operation
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does "likely" mean? Would it be more accurate to say "possibly" or "potentially"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, my thought was that we can't be sure it's transient, but also that the status code is a strong sign it's transient. Felt "likely" was the best fit though I don't care too much about this and I'm happy to switch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this to:

    /// Returns `true` if this error indicates that it is transient, and that
    /// the operation could succeed if retried.

/// * 504 Gateway Timeout
///
/// These status codes are checked for all error variants that carry an
/// HTTP status, since infrastructure components like load balancers
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// HTTP status, since infrastructure components like load balancers
/// HTTP status, since infrastructure components such as load balancers

Comment on lines 382 to 383
/// may return transient errors with bodies that don't conform to the
/// API schema.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't follow this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was trying to draw a distinction between ErrorResponse (known, expected error type) and UnexpectedResponse (unknown error type) here. My thought was that a load balancer or similar might return an error that doesn't follow the schema—not a problem we'd generally have for our internal services.

But on second thought, an unknown error type is more general than that, so we should just drop this comment. The right thing to do is to check all the variants anyway.

Comment on lines 390 to 392
// We expect this to be a 2xx status, but that assumption is a
// bit fragile. is_retryable_status returns false for 2xx status
// codes anyway, so check for that.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you explain this fragility? Or is it more like: these should be 2xx but there's no harm in checking if we happen to have a status code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, this. Can attempt to clarify this in the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, and in particular talked about the situations where they might not be 2xx statuses (since this is an enum, something outside progenitor could create it—I'm pretty sure I've written tests of that kind)

Created using spr 1.3.6-beta.1
Copy link
Collaborator

@ahl ahl left a comment

Choose a reason for hiding this comment

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

looks great

@sunshowers sunshowers merged commit 0fc03d0 into main Feb 12, 2026
12 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/progenitor-client-add-erroris_retryable branch February 12, 2026 00:25
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

Comments