Skip to content

Added max_tries WebProfiler configuration property #15670

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

Closed
wants to merge 1 commit into from
Closed

Added max_tries WebProfiler configuration property #15670

wants to merge 1 commit into from

Conversation

kptLucek
Copy link

@kptLucek kptLucek commented Sep 2, 2015

Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

This property were required in project im working on, due to really long load time - profiler couldn't store data in defined 5 tries.


public function __construct(\Twig_Environment $twig, $interceptRedirects = false, $mode = self::ENABLED, $position = 'bottom', UrlGeneratorInterface $urlGenerator = null, $excludedAjaxPaths = '^/bundles|^/_wdt')
public function __construct(\Twig_Environment $twig, $interceptRedirects = false, $mode = self::ENABLED, $position = 'bottom', $maxTries = 3, UrlGeneratorInterface $urlGenerator = null, $excludedAjaxPaths = '^/bundles|^/_wdt')
Copy link
Member

Choose a reason for hiding this comment

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

Here, the default value of maxTries is 3, but in the rest of the code is 5.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for notice, already fixed

@javiereguiluz
Copy link
Member

@kptLucek I'd like to ask you what is the rationale behind this change, because I don't understand why this option is needed. Thanks!


public function __construct(\Twig_Environment $twig, $interceptRedirects = false, $mode = self::ENABLED, $position = 'bottom', UrlGeneratorInterface $urlGenerator = null, $excludedAjaxPaths = '^/bundles|^/_wdt')
public function __construct(\Twig_Environment $twig, $interceptRedirects = false, $mode = self::ENABLED, $position = 'bottom', $maxTries = 5, UrlGeneratorInterface $urlGenerator = null, $excludedAjaxPaths = '^/bundles|^/_wdt')
Copy link
Contributor

Choose a reason for hiding this comment

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

This is BC break.

Copy link
Author

Choose a reason for hiding this comment

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

You're right! My miss, thanks for notice.

@kptLucek
Copy link
Author

kptLucek commented Sep 2, 2015

@javiereguiluz you were pretty fast tho, were typing why such change were made in time when recived your's comment.

As described - sometimes profiler couldn't store data in defined 5 tries, that's why i had to override template manually in app directory to make this works, sometimes it does take ~10-15 attempts to recive working toolbar.

@javiereguiluz
Copy link
Member

Anyone knows why can the profiler fail and why could it fail more than 5 times but less than 10 (as in @kptLucek case)?

@fabpot
Copy link
Member

fabpot commented Sep 2, 2015

We have always been against adding settings for no good reasons. If we need to increase from 5 to 15, let's do that, but making it configurable does not make sense as people won't know why/when to change this value.

Another possibility would be to find another way to deal with this problem (ping @tucksaun).

@kptLucek
Copy link
Author

kptLucek commented Sep 2, 2015

Situation described here is happening to me mostly, when in template which is being rendered are too many render(controller()) (varnish on prod so doesn't really matter).

Whole cache is being build in ~3-5 min, usual response time is around 3-10s (container's weight is more than 10mb).

I think (as described above) that problem is somewhere in between storing - reading profiler's data, after request is completed, they're still being written which means that they're not accesible yet

@fabpot
Copy link
Member

fabpot commented Sep 2, 2015

The problem happens when there is a lot happening during the kernel.terminate (like sending emails) or when there are a lot of sub-requests. Another option (which was discussion back then when we introduces this retry mechanism) is to display an empty toolbar with a spinner that retries indefinitely and a button to abort.

@javiereguiluz
Copy link
Member

I like the idea of showing a loading indicator explaining the situation. A quick mockup:

symfony-toolbar-loading

@kptLucek
Copy link
Author

kptLucek commented Sep 2, 2015

Well, idea is good, but how would you describe when this loading should end? I mean, how many attempts and then "enough" of trying? Or maybe an infinite loop?

@javiereguiluz
Copy link
Member

@kptLucek infinite loop and ideally a link to abort it, as Fabien said.

@kptLucek
Copy link
Author

kptLucek commented Sep 2, 2015

I'll take care about this one then

@fabpot
Copy link
Member

fabpot commented Sep 2, 2015

Abort is needed as the spinner will never end if the profile is not stored for any reasons.

@fabpot
Copy link
Member

fabpot commented Sep 14, 2015

@kptLucek I'm closing this PR as it cannot be merged. I will let you open a new one with the other approach as discussed here. Thanks.

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.

5 participants