Skip to content

Conversation

@zizou-ben
Copy link

No description provided.

@MP-Aubay
Copy link
Contributor

MP-Aubay commented May 20, 2025

Hi @zizou-ben , thank you for this interesting rule.
I wonder if using a max timeout value is relevant, and how to determine the right value ...
But I think it could be a good practice to always add retryFor argument to avoid retry on a FileNotFoundException or others like this one.

Do not forget to update CHANGELOG.md and RULES.md files !

@zizou-ben
Copy link
Author

Hello,
Thank you for your reply. Interesting point points you brought up, a max timeout in this is absolutely necessary considering that the max delay for a retryable with (max retry 3,delay:10, multiplier 100) consumes more than a retryable with (max retry 6, delay 10,and no multiplier) as we can see depending on the values of all three parameters (or lack there of) the max timeout can grow exponentially, and the only way to estimate is to calculate the result. We have configured a value for maxtimeout doing some research on existing apps ( our rule can be later improved to make this value configurable.
For your second point I am not sure I understand what you mean by retry for.
And lastly for the changelog i guess we have to do it manually not using out commit messages
Thank you for your help

@zizou-ben zizou-ben changed the title Changelog add rule GCI604 GCI604 [ELAN]-2025 Changelog add rule May 21, 2025
@MP-Aubay MP-Aubay changed the title GCI604 [ELAN]-2025 Changelog add rule GCI604 [Team ELAN][2025] - Changelog add rule May 21, 2025
@dedece35 dedece35 requested review from Copilot and dedece35 July 4, 2025 15:08
Copy link

Copilot AI left a comment

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 introduces a new rule (GCI604) to enforce a maximum retry timeout for Spring Retry and updates the changelog accordingly.

  • Added Asciidoc documentation detailing the rule’s rationale, examples, and threshold
  • Added JSON metadata for the new rule
  • Updated CHANGELOG with an Unreleased entry for GCI604

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/main/rules/GCI604/java/GCI604.asciidoc Documentation for GCI604 explaining inconsistent retry configuration
src/main/rules/GCI604/GCI604.json JSON metadata for rule GCI604
CHANGELOG.md Added Unreleased changelog entry for rule GCI604
Comments suppressed due to low confidence (4)

src/main/rules/GCI604/java/GCI604.asciidoc:1

  • The first line duplicates the document title; consider removing it or converting it into a proper Asciidoc heading (e.g., prefixing with =) to avoid redundancy.
Spring Retry: Inconsistent configuration

src/main/rules/GCI604/GCI604.json:2

  • The JSON title is too generic and doesn't match the Asciidoc title; consider updating it to 'Inconsistent Spring Retry Configuration' or another descriptive name.
  "title": "limit retry",

src/main/rules/GCI604/GCI604.json:1

  • The rule metadata lacks a configurable parameter for max.timeout; add a properties section defining this parameter with a default value and description.
{

CHANGELOG.md:11

  • There's a duplicated ## [Unreleased] header in the changelog; remove the redundant section to keep a single Unreleased block.
## [Unreleased]

"sobriety",
"environment",
"creedengo",
"spring-boot",
Copy link
Member

Choose a reason for hiding this comment

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

not only for spring-boot but also for "spring"

Spring Retry: Inconsistent configuration
= Inconsistent Spring Retry Configuration

An inconsistent configuration of Spring Retry can lead to blocking threads and increased energy usage.
Copy link
Member

Choose a reason for hiding this comment

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

could you please add some references like :

if we respect our process for a new rule ... we have to give evidence to prove that its a good idea like :


[source,java]
----
@Retryable(maxAttempts = 5, backoff = @Backoff(delay = 10))
Copy link
Member

Choose a reason for hiding this comment

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

maybe give some other compliant examples with acceptable "multiplier" or the "maxDelay" given to limit the maximum timeout
because we can have a relevant use case that the multiplier is relevant (for example, call an external URL to limit de spend of too much call tokens) ... but I agree, we have to control it not to consume a lot of resources.

@@ -0,0 +1,17 @@
{
"title": "limit retry",
Copy link
Member

Choose a reason for hiding this comment

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

please change the title to something more explicit

This rule applies to usages of `@Retryable` only.
A threshold `max.timeout` defines the maximum acceptable blocking time (in milliseconds).

`max.timeout=50000`
Copy link
Member

Choose a reason for hiding this comment

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

what is the good value for max timeout ? maybe also describe de "maxDelay" parameter

@dedece35
Copy link
Member

dedece35 commented Jul 4, 2025

Hi @zizou-ben,

after checking some web documentation, this rule is a good idea but there is a lack on some subjects like explained here https://www.baeldung.com/spring-retry
We can use "Retryable" system with different ways :

  • @retryable : ok, you dealt with it
  • Spring Properties
  • RetryTemplate system
    Maybe can we these lacked subjects inside another PR ?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

This PR has been automatically marked as stale because it has no activity for 60 days.
Please add a comment if you want to keep the issue open. Thank you for your contributions!

@github-actions github-actions bot added the stale label Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants