Bug #89831

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 5 days ago. Updated 4 days ago.

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

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

History

#1 Updated by Georg Ringer 5 days 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'
        ];
    }

#2 Updated by Stefan P 4 days 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)

Also available in: Atom PDF