Project

General

Profile

Actions

Bug #89716

closed

identifier not null in sys_file_processedfile

Added by Florian Schuhmann over 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2019-11-20
Due date:
% Done:

100%

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

Description

I'm running a TYPO3 v9.5.11 with an implementation of adaptive images which leads to a huge amount of processed files.

Additionally if have upscaling disabled:

$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_allowUpscaling'] = false;

So in many cases the original files should get rendered in fe without processing.

This change led to a performance slump, which was inexplicable to me.
During my research i have found some processed files in the database, which are updated on every request even if the page should be cached.

These entries have the following properties set:

identifier=''
name=null

After more search I came to bug #62400 which is "Rejected" and points me to the TYPO3\CMS\Core\Resource\ProcessedFile:

 * A file may also meet the expectations set in the configuration without any processing. In that case, the
 * ProcessedFile object still exists, but there is no physical file directly linked to it. Instead, it then
 * redirects most method calls to the original file object. The data of these objects are also stored in the
 * database, to indicate that no processing is required. With such files, the identifier and name fields in the
 * database are empty to show this.

Therefore, the existence of these entries is correct. But i think these properties should have the same value (null) in the database:

identifier=null
name=null

These files are always touched while the condition never matches in \TYPO3\CMS\Core\Resource\ProcessedFile::usesOriginalFile

public function usesOriginalFile()
{
    return $this->identifier === null || $this->identifier === $this->originalFile->getIdentifier();
}

or in \TYPO3\CMS\Core\Resource\ProcessedFile::updateWithLocalFile

if ($this->identifier === null) {
    throw new \RuntimeException('Cannot update original file!', 1350582054);
}

To fix this the database structure should get fixed.

The identifier is created like this:

identifier varchar(512) DEFAULT '' NOT NULL,

But the default should be NULL

identifier varchar(512) DEFAULT NULL,

Only in this case, the condition matches and the files are not constantly updated.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #62400: Lot of entries in sys_file_processed with name=NULL and identifier emptyRejectedAndreas Wolf2014-10-22

Actions
Actions #1

Updated by Florian Schuhmann over 4 years ago

  • Related to Bug #62400: Lot of entries in sys_file_processed with name=NULL and identifier empty added
Actions #2

Updated by Florian Schuhmann over 4 years ago

  • Subject changed from identifier not null in sys_file_processed to identifier not null in sys_file_processedfile
Actions #3

Updated by Markus Klein over 4 years ago

Good catch. For backporting such changes though, we can't do DB schema adjustments.
So do you see a good way to adjust the conditions accordingly?

Feel free to push a patch to Gerrit. Thanks.

Actions #4

Updated by Gerrit Code Review over 4 years ago

  • Status changed from New 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/+/62538

Actions #5

Updated by Gerrit Code Review over 4 years ago

Patch set 2 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/+/62538

Actions #6

Updated by Gerrit Code Review about 4 years ago

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

Actions #7

Updated by Anonymous about 4 years ago

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

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions #9

Updated by Gerrit Code Review about 4 years ago

  • Status changed from Closed to Under Review

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

Actions #10

Updated by Anonymous about 4 years ago

  • Status changed from Under Review to Resolved
Actions #11

Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed
Actions #12

Updated by Anonymous about 3 years ago

Anonymous wrote in #note-10:

Applied in changeset 7d765c8d3be1d15f087a659c75c41e2275d9e0d9.

Awesome!

Actions

Also available in: Atom PDF