Skip to content
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

[BUG] SolrRoutingMiddleware is always in php-slow.log #3810

Closed
Tracked by #3376
dmitryd opened this issue Oct 3, 2023 · 3 comments · Fixed by #3816
Closed
Tracked by #3376

[BUG] SolrRoutingMiddleware is always in php-slow.log #3810

dmitryd opened this issue Oct 3, 2023 · 3 comments · Fixed by #3816
Assignees

Comments

@dmitryd
Copy link
Contributor

dmitryd commented Oct 3, 2023

Describe the bug

Seeing a lot of these:

[03-Oct-2023 18:49:51]  [pool prod12] pid 613543
script_filename = /home/prod12/public/index.php
[0x00007f044f213d80] makeInstance() /home/prod12/vendor/typo3/cms-core/Classes/Routing/Enhancer/EnhancerFactory.php:61
[0x00007f044f213cd0] create() /home/prod12/vendor/typo3/cms-core/Classes/Routing/PageSlugCandidateProvider.php:175
[0x00007f044f213c10] getDecoratingEnhancers() /home/prod12/vendor/typo3/cms-core/Classes/Routing/PageSlugCandidateProvider.php:149
[0x00007f044f213b80] getRoutePathRedecorationPattern() /home/prod12/vendor/typo3/cms-core/Classes/Routing/PageSlugCandidateProvider.php:442
[0x00007f044f213a90] getCandidateSlugsFromRoutePath() /home/prod12/vendor/typo3/cms-core/Classes/Routing/PageSlugCandidateProvider.php:73
[0x00007f044f213970] getCandidatesForPath() /home/prod12/vendor/apache-solr-for-typo3/solr/Classes/Middleware/SolrRoutingMiddleware.php:288
[0x00007f044f213850] retrievePageInformation() /home/prod12/vendor/apache-solr-for-typo3/solr/Classes/Middleware/SolrRoutingMiddleware.php:109
[0x00007f044f213740] process() /home/prod12/vendor/typo3/cms-core/Classes/Http/MiddlewareDispatcher.php:162
[0x00007f044f2136a0] handle() /home/prod12/vendor/typo3/cms-core/Classes/Middleware/NormalizedParamsAttribute.php:41
[0x00007f044f213620] process() /home/prod12/vendor/typo3/cms-core/Classes/Http/MiddlewareDispatcher.php:162
[0x00007f044f213580] handle() /home/prod12/vendor/typo3/cms-core/Classes/Middleware/VerifyHostHeader.php:55
[0x00007f044f2134c0] process() /home/prod12/vendor/typo3/cms-core/Classes/Http/MiddlewareDispatcher.php:162
[0x00007f044f213420] handle() /home/prod12/vendor/typo3/cms-frontend/Classes/Middleware/TimeTrackerInitialization.php:48
[0x00007f044f213370] process() /home/prod12/vendor/typo3/cms-core/Classes/Http/MiddlewareDispatcher.php:162
[0x00007f044f2132d0] handle() /home/prod12/vendor/typo3/cms-core/Classes/Http/MiddlewareDispatcher.php:70
[0x00007f044f213260] handle() /home/prod12/vendor/typo3/cms-core/Classes/Http/AbstractApplication.php:80
[0x00007f044f2131d0] handle() /home/prod12/vendor/typo3/cms-frontend/Classes/Http/Application.php:59
[0x00007f044f213160] handle() /home/prod12/vendor/typo3/cms-core/Classes/Http/AbstractApplication.php:92
[0x00007f044f2130f0] run() /home/prod12/public/index.php:20
[0x00007f044f213080] {closure}() /home/prod12/public/index.php:21

No slow logs without this middleware.

php-slow.log.zip

This middleware is executed when indexing does not happen and it seems it replicates the whole routing procedure. So routing happens twice. Can't it run after the normal routing middleware and use its results, may be?

Used versions (please complete the following information):

  • TYPO3 Version: 12.4.6
  • EXT:solr Version: 12.0.0-RC1
  • PHP Version: 8.1.0
@dmitryd
Copy link
Contributor Author

dmitryd commented Oct 4, 2023

Is it actually correct that it runs every time when NOT indexing? I disabled it completely and no entries in slow log any more.

@dkd-friedrich
Copy link
Member

Is it actually correct that it runs every time when NOT indexing? I disabled it completely and no entries in slow log any more.

Yes, that is right. The component is not needed for indexing, but to generate speaking URLs for the facets.

However, since the enhancer is having such a negative effect, I think we should look into this. Maybe we can integrate a switch that allows an early exit and disable the enhancer by default. My last impression is that the feature is hardly used and therefore an explicit activation is acceptable.

@dmitryd
Copy link
Contributor Author

dmitryd commented Oct 4, 2023

The component is not needed for indexing, but to generate speaking URLs for the facets.

But if there are 1000 requests to /, then it works all 1000 times. Can't it cache results per url, for example? Just an idea.

@dkd-friedrich dkd-friedrich self-assigned this Oct 9, 2023
dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Oct 9, 2023
Renaming of 3 events related to routing caused failures in route
generation in TYPO3 12. This commit replaces the old events
in all occurences missed in the first step and restores the
route enhancer functions.

Relates: TYPO3-Solr#3681
Relates: TYPO3-Solr#3810
dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Oct 9, 2023
EXT:solr offers the possibility to create speaking URLs for Solr
facets, but as this feature requires additional configuration and
costly processing this feature is now disabled by default.

If you've already used the route enhancer you must set option
"enableRouteEnhancer":
$TYPO3_CONF_VARS['EXTENSIONS']['solr']['enableRouteEnhancer']

Resolves: TYPO3-Solr#3810
dkd-kaehm pushed a commit that referenced this issue Oct 10, 2023
Renaming of 3 events related to routing caused failures in route
generation in TYPO3 12. This commit replaces the old events
in all occurences missed in the first step and restores the
route enhancer functions.

Relates: #3681
Relates: #3810
dkd-kaehm pushed a commit that referenced this issue Oct 10, 2023
EXT:solr offers the possibility to create speaking URLs for Solr
facets, but as this feature requires additional configuration and
costly processing this feature is now disabled by default.

If you've already used the route enhancer you must set option
"enableRouteEnhancer":
$TYPO3_CONF_VARS['EXTENSIONS']['solr']['enableRouteEnhancer']

Resolves: #3810
dkd-friedrich added a commit that referenced this issue Oct 13, 2023
Adds an integration test for the Solr route enhancer and the
newly integrated extension configuration "enableRouteEnhancer".

Relates: #3810
dkd-friedrich added a commit that referenced this issue Oct 13, 2023
Improves the structure, implementation and documentation of
ext_conf_template.php.

Relates: #3810
dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Oct 13, 2023
Adds missing documentation for the following extension configuration
settings:
- pluginNamespaces
- includeGlobalQParameterInCacheHash
- useConfigurationMonitorTables
- enableRouteEnhancer

Relates: TYPO3-Solr#2725
Relates: TYPO3-Solr#3810
dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Oct 13, 2023
Improves the structure, implementation and documentation of
ext_conf_template.php.

Relates: TYPO3-Solr#3810
dkd-kaehm pushed a commit that referenced this issue Oct 13, 2023
Adds an integration test for the Solr route enhancer and the
newly integrated extension configuration "enableRouteEnhancer".

Relates: #3810
dkd-kaehm pushed a commit that referenced this issue Oct 13, 2023
Adds missing documentation for the following extension configuration
settings:
- pluginNamespaces
- includeGlobalQParameterInCacheHash
- useConfigurationMonitorTables
- enableRouteEnhancer

Relates: #2725
Relates: #3810
dkd-kaehm pushed a commit that referenced this issue Oct 13, 2023
Improves the structure, implementation and documentation of
ext_conf_template.php.

Relates: #3810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants