Skip to content

Conversation

@Whaileee
Copy link
Contributor

No description provided.

@Whaileee Whaileee requested a review from IngelaAndin December 12, 2025 11:44
@Whaileee Whaileee self-assigned this Dec 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

CT Test Results

  2 files   23 suites   9m 57s ⏱️
366 tests 360 ✅  6 💤 0 ❌
747 runs  664 ✅ 83 💤 0 ❌

Results for commit 7a22929.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

Undefined =:= undefined orelse
AutoRetryOpt =:= false ->
status_server_error_50x(Response, Request);
Time when (length(Time) < 3) -> % Wait only 99 s or less
Copy link
Contributor

Choose a reason for hiding this comment

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

Thats unexpected from the docs... Max amount of time one waits should be documented or configurable IMO.
Also, retry-after can contain Date which would cause next line to crash

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, it wouldn't crash because length would be >= 3, my bad. But anyways, shouldn't that behavior be documented in more detail like (e.g.: "retry-after Date is not respected, retry-after Seconds is respected to at max 99 seconds")?

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 agree, this part needs some more polishing. Thanks for bringing attention.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could make automatic retry only be automatic if retry-after time is reasonable short. This would behave a little different from now, but we could argue that this would be less surprising. I do not know the reason for 99 s but that seems unreasonable long and was not documented.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, I'd want something like {autoretry, #{max_retries=>X, max_waiting_time=>Y}}. Default would be {max_retries=>0, max_waiting_time=>Y}. Capping max_retries and max_waiting_time would prevent possible "infinite wait".

What's "reasonable short" is very dependent on the application and this way we let the user specify the terms.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hum well maybe {autoretry, timeout()} would make sense instead of having to many knobs ! Httpc can then itself handle how many possible retries it can have before giving up, and a timeout of zero imply no automatic retries. I agree that reasonable short is hard to determine especially for the library, but due to backwards compatibility we might still want to settle for some fairly short default timeout.

Copy link
Contributor

@MarkoMin MarkoMin Dec 16, 2025

Choose a reason for hiding this comment

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

Works for me, but what's unfortunate is that HTTP retry-after is in seconds while timeout often refers to milliseconds so having something like #{max_waiting_seconds => non_neg_integer()} instead of timeout() would clarify the API.

We can also just stick to {autoretry, timeout()} but we must be explicit in the docs that this timeout means seconds.

@rickard-green rickard-green added the team:PS Assigned to OTP team PS label Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants