Skip to content

Conversation

@Qqwy
Copy link
Contributor

@Qqwy Qqwy commented Oct 31, 2025

Before, this would result in a non-ephemeral InternalProducerClientError as the client would still attempt to decode JSON from the response body even on a non-200 HTTP status.

@Qqwy Qqwy requested a review from SemMulder October 31, 2025 13:16
Copy link
Contributor

@SemMulder SemMulder left a comment

Choose a reason for hiding this comment

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

Awesome! Two small comments.

Comment on lines 164 to 169
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you might have missed this one? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have now added an .error_for_status() call to the version endpoint call, but intentionally leave out any retry logic there, as that endpoint is intended to (only) be used by hand. (There is also no parsing of the response result going on).

// Maybe a different HTTP client library is nicer in this regard?
Self::HTTPClientError(inner) => {
inner.is_connect() || inner.is_timeout() || inner.is_decode()
inner.is_status() || inner.is_connect() || inner.is_timeout() || inner.is_decode()
Copy link
Contributor

Choose a reason for hiding this comment

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

This marks everything from 400 to 599 inclusive as ephemeral.

Do we really want to include the whole 400 range? E.g. what if we post a bad body because of some version mismatch or something? I'm too unfamiliar with the code to judge whether it matters, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, only catching 5xx is the correct approach.

4xx errors can (only?) come up if e.g. a Traefik or other prroxy in the middle is misconfigured, in which case we'd like to see that early.

Copy link
Contributor

Choose a reason for hiding this comment

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

One edge-case is 429 Too Many Requests though, in that case you likely want to retry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly. Let's see if we end up triggering that case in production.

@Qqwy
Copy link
Contributor Author

Qqwy commented Nov 3, 2025

@OpsBotPrime merge and deploy to production

@OpsBotPrime
Copy link
Contributor

Unknown or invalid command found:

comment:1:30:
  |
1 | @OpsBotPrime merge and deploy to production
  |                              ^
No deployment environments have been configured.

Basic usage is explained here.

@Qqwy
Copy link
Contributor Author

Qqwy commented Nov 3, 2025

@OpsBotPrime merge and tag

@OpsBotPrime
Copy link
Contributor

Rebased as 74328de, waiting for CI …

OpsBotPrime added a commit that referenced this pull request Nov 3, 2025
…etrying

Approved-by: Qqwy
Priority: Normal
Auto-deploy: false
@OpsBotPrime
Copy link
Contributor

CI job 🟡 started.

@OpsBotPrime
Copy link
Contributor

The build failed ❌.

If this is the result of a flaky test, then tag me again with the retry command. Otherwise, push a new commit and tag me again.

@Qqwy
Copy link
Contributor Author

Qqwy commented Nov 3, 2025

@OpsBotPrime retry

Qqwy and others added 3 commits November 3, 2025 11:33
Before, this would result in a non-ephemeral `InternalProducerClientError`
as the client would still attempt to decode JSON from the response body
even on a non-200 HTTP status.
…etrying

Approved-by: Qqwy
Priority: Normal
Auto-deploy: false
@OpsBotPrime
Copy link
Contributor

Rebased as b4fb822, waiting for CI …

@OpsBotPrime
Copy link
Contributor

CI job 🟡 started.

@OpsBotPrime OpsBotPrime force-pushed the producer_client-retry_on_http_status_failures branch from 3b8bae3 to b4fb822 Compare November 3, 2025 10:37
@OpsBotPrime
Copy link
Contributor

@Qqwy I tagged your PR with v37. Please wait for the build of b4fb822 to pass and don't forget to deploy it!

@OpsBotPrime OpsBotPrime merged commit b4fb822 into master Nov 3, 2025
6 of 7 checks passed
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.

3 participants