Project

General

Profile

Actions

Bug #89831

closed

System information toolbar slows down or breaks BE login because it queries all configured database connections which may be slow/gone

Added by Stefan P over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2019-12-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Needs Decision

Description

Steps to reproduce:

  1. Have a TYPO3 setup
  2. configure multiple Database conenctions where at least one is slow or currently gone
  3. log into the Backend
  4. login takes forever because the slow or even fails with error because the unavailable (-> fail with timeout) DB is queried as well

Expected result: Only databases that are actually used are queried.

It's totally valid to have slow or unavailable Databases configured in the Connection Pool. For example when using them for scheduled interface commands to import data from foreign data sources.

TYPO3 should not query all configured Databases if there's no current need. It's OK to list the configured ones, but actual connections should not be opened without demand.

The causing code is the class SystemInformationToolbarItem - the getDatabase() method.

Even when having fast connections: having many of fast connections can still slow down the login.


Files

screenshot1.png (40.9 KB) screenshot1.png Susanne Moog, 2020-03-19 13:50
Actions #1

Updated by Georg Ringer over 4 years ago

  • Status changed from New to Needs Feedback

thanks for creating this issue. The method getDatabase lists all used databases including their version.

the only option I see is to just show the default connection and remove the listing of all others. do you see any other option?

code would look like this then

    protected function getDatabase()
    {
        $this->systemInformation[] = [
            'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.database',
            'titleAddition' => ConnectionPool::DEFAULT_CONNECTION_NAME,
            'value' => GeneralUtility::makeInstance(ConnectionPool::class)
                ->getConnectionByName(ConnectionPool::DEFAULT_CONNECTION_NAME)
                ->ping(),
            'iconIdentifier' => 'information-database'
        ];
    }

Actions #2

Updated by Stefan P over 4 years ago

This is a possibility.

Another way: Only list Default and all connection that explicitly have tables mapped to them (we get them by connection name not by table name, because no tables are mapped to the TYPO3 system itself, because they are only needed in foreign data retrieval in commands)

Yet another way: add a flag that allows to mark connections as "external", like 'external' => true and let the Toolbar only show "Default" and "non-external" and skip all "external" ones.

Or a combination of both ways. List all that are: Default OR (have tables mapped AND NOT external)

Actions #3

Updated by Georg Ringer about 4 years ago

  • Sprint Focus set to PRC
Actions #4

Updated by Susanne Moog about 4 years ago

I agree that an error on a non-essential connection should not result in an exception or a hard error, however I think it's useful to display the status of all globally configured connections.

For your use case of configuring database connections that are only used at certain points of the code (and should therefor also not be used by the next developer who might think that he needs to) I would suggest to fully configure the database either conditionally in additionalConfiguration or runtime. While it's a valid use case I do consider it bad form to provide that connection globally if it is not generally available.

I'm going to push a patch to address the first part of this issue.

Actions #5

Updated by Gerrit Code Review about 4 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63796

Actions #7

Updated by Susanne Moog about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Stefan P about 4 years ago

A step in the right direction, but this won't solve the problem about slow loading times. The Backend will still wait for the timeout to happen on unavailable connections before continuing.

Actions #9

Updated by Benni Mack about 4 years ago

  • Sprint Focus changed from PRC to Needs Decision
Actions #10

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF