Issue Bug Closed

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

S P 12/03/19, 08:05 updated 04/01/20, 21:14

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.

Reviews 1

Files 1

History 910

  1. Georg Ringer commented and changed status New Needs Feedback 12/03/19, 16:45

    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. S P commented 12/04/19, 07:13

    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)

  3. Georg Ringer changed Sprint Focus PRC 03/17/20, 14:57

  4. Susanne Moog commented 03/19/20, 13:48

    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.

    screenshot1.png

  5. Gerrit Code Review pushed patch set 1 for master to change 63796 status Needs Feedback Under Review 03/19/20, 13:48

  6. Susanne Moog changed attached screenshot1.png 03/19/20, 13:50

  7. Susanne Moog commented and changed status Under Review Resolved done 0 % 100 % 03/19/20, 21:00

    Applied in changeset commit:65e23a9b1e111c4ee29f34905d22d4a3916597c6.

  8. S P commented 03/20/20, 07:12

    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.

  9. Benni Mack changed Sprint Focus PRC Needs Decision 03/24/20, 17:52

  10. Benni Mack changed status Resolved Closed 04/01/20, 21:14