Skip to content

[WebProfilerBundle] Add simple backoff strategy on 404 #41115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2021

Conversation

loevgaard
Copy link
Contributor

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #41112
License MIT

Instead of just retrying every second 5 times, this PR implements a very basic backoff strategy where it waits 1, 1, 2, 3, 5 seconds between the respective requests instead which amounts to a total wait of 12 seconds instead of 5.

@carsonbot carsonbot changed the title Add simple backoff strategy on 404 [WebProfilerBundle] Add simple backoff strategy on 404 May 6, 2021
@loevgaard
Copy link
Contributor Author

@stof: I have made a new backoff strategy that actually uses the number of request tries. What do you think? The sequence would now be 1, 2, 4, 8, 16 seconds.

@loevgaard
Copy link
Contributor Author

I changed from ** to Math.pow because of this: https://caniuse.com/mdn-javascript_operators_exponentiation

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(would work for me as a "minor" in 5.3)

@loevgaard
Copy link
Contributor Author

Cool, thank you :)

@nicolas-grekas
Copy link
Member

Thank you @loevgaard.

@nicolas-grekas nicolas-grekas merged commit 173cf48 into symfony:5.x May 7, 2021
@aleho
Copy link
Contributor

aleho commented May 17, 2021

Nice addition!

Is the change regarding "infinite" loading, as suggested in #15670, still viable?

I could provide a PR with that, if you think loading without max-retries is an option.

@loevgaard loevgaard deleted the patch-1 branch May 17, 2021 13:09
@loevgaard
Copy link
Contributor Author

With this PR the user has waited 31 seconds if the the 5th try is executed. I am not sure anybody would wait longer than that, but I could be wrong :D

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.

Debug bar erroring with 404
6 participants