Review main Merged

65237[BUGFIX] Implement deferred BE image processing consistently

Helmut Hummel CR +2 V +2 Hard +574 −60 updated 11/14/20, 19:16

Commit message

Change the implementation of backend deferred image processing
to use a file processor, which is only but always used in the backend.

By doing so all limitations of the current implementation are resolved,
which means, width and height of the image can be set in HTML, to avoid
layout shifts and once the images are processed, they will simply
be delivered by the web server.

Inconsistencies with thumbnail ratio (depending on crop being defined
or not) are also tackled on the go.

While this changes processing configuration for some files,
which triggers a re-generation, it should not matter, as image
processing will be done in parallel on request, making such changes
viable in a bugfix release.

The introduced database field is neither used nor required for the
current implementation, but is introduced to provide a possibility for
third party processors to replace the current implementation with simple
(and persisted) URLs to third party SaaS image processing services.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Markus Klein +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Markus Klein +1
    • TYPO3com +1 CI

Issues 1

Files 17

Review log 6897

Show 5072 earlier messages
  1. Helmut Hummel uploaded patch set 1 08/10/20, 10:43

  2. TYPO3com voted on patch set 1 V -1 08/10/20, 10:44 Completed build in 47s on Mon, 10 Aug, 10:44 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4543

  3. Helmut Hummel uploaded patch set 2 08/10/20, 17:49

  4. TYPO3com voted on patch set 2 V -1 08/10/20, 17:49 Completed build in 27s on Mon, 10 Aug, 05:49 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4550

  5. Helmut Hummel updated the commit message in patch set 3 08/10/20, 17:52

  6. TYPO3com voted on patch set 3 V -1 08/10/20, 17:52 Completed build in 27s on Mon, 10 Aug, 05:52 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4551

  7. Helmut Hummel uploaded patch set 4 08/11/20, 15:49

  8. TYPO3com voted on patch set 4 V -1 08/11/20, 15:50 Completed build in 32s on Tue, 11 Aug, 03:50 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4583

  9. Helmut Hummel uploaded patch set 5 08/13/20, 12:26

  10. TYPO3com voted on patch set 5 V -1 08/13/20, 12:26 Completed build in 27s on Thu, 13 Aug, 12:26 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4622

  11. Helmut Hummel uploaded patch set 6 08/13/20, 13:14

  12. TYPO3com voted on patch set 6 V -1 08/13/20, 13:15 Completed build in 28s on Thu, 13 Aug, 01:15 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4626

  13. Helmut Hummel uploaded patch set 7 08/14/20, 12:08

  14. Helmut Hummel uploaded patch set 8 08/14/20, 12:09

  15. TYPO3com voted on patch set 7 V -1 08/14/20, 12:09 Completed build in 27s on Fri, 14 Aug, 12:09 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4658

  16. TYPO3com voted on patch set 8 V -1 08/14/20, 12:22 Completed build in 12m 50s on Fri, 14 Aug, 12:22 PM Test Summary: 24 of 73470 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4659

  17. Helmut Hummel uploaded patch set 9 09/03/20, 17:16

  18. TYPO3com voted on patch set 9 V -1 09/03/20, 17:28 Completed build in 11m 45s on Thu, 3 Sep, 05:28 PM Test Summary: 18 of 73667 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5197

  19. Helmut Hummel uploaded patch set 10 09/03/20, 18:56

  20. TYPO3com voted on patch set 10 V -1 09/03/20, 19:07 Completed build in 11m 13s on Thu, 3 Sep, 07:07 PM Test Summary: 73182 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5199

  21. Helmut Hummel uploaded patch set 11 09/03/20, 19:26

  22. TYPO3com voted on patch set 11 V -1 09/03/20, 19:37 Completed build in 11m 26s on Thu, 3 Sep, 07:37 PM Test Summary: 73181 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5202

  23. Benni Mack commented on patch set 11 09/03/20, 20:12

    great work!
  24. Tymoteusz Motylewski commented on patch set 11 09/03/20, 20:21

    SaaS
  25. Helmut Hummel uploaded patch set 12 09/06/20, 12:43

  26. Helmut Hummel commented on patch set 12 09/06/20, 12:44

    Reply

    Done
  27. TYPO3com voted on patch set 12 V +1 09/06/20, 12:54 Completed build in 11m 12s on Sun, 6 Sep, 12:54 PM Test Summary: 73212 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5302

  28. Helmut Hummel uploaded patch set 13 09/06/20, 13:16

  29. Helmut Hummel uploaded patch set 14 09/06/20, 13:34

  30. TYPO3com voted on patch set 13 V +1 09/06/20, 13:35 Completed build in 17m 49s on Sun, 6 Sep, 01:35 PM Test Summary: 73226 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5303

  31. TYPO3com voted on patch set 14 V +1 09/06/20, 13:46 Completed build in 11m 19s on Sun, 6 Sep, 01:46 PM Test Summary: 73227 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5305

  32. Helmut Hummel uploaded patch set 15 09/07/20, 10:09

  33. Oliver Klee commented on patch set 15 09/07/20, 10:24

    ProcessedFile.php:112

    string|null

    ProcessedFile.php:152

    Should this be indeed null or an empty string?

    ProcessedFile.php:428

    Should this be an empty string or null?
  34. TYPO3com voted on patch set 15 V +1 09/07/20, 16:38 Completed build in 18m 51s on Mon, 7 Sep, 04:38 PM Test Summary: 73227 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5336

  35. Helmut Hummel commented on patch set 15 09/12/20, 13:07

    ProcessedFile.php:112 Reply

    Done

    ProcessedFile.php:152 Reply

    Done

    ProcessedFile.php:428 Reply

    Done
  36. Helmut Hummel uploaded patch set 16 09/12/20, 13:08

  37. TYPO3com voted on patch set 16 V +1 09/12/20, 13:19 Completed build in 11m 24s on Sat, 12 Sep, 01:19 PM Test Summary: 73209 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5557

  38. Oliver Klee wrote 09/12/20, 15:41

    Removed reviewer Oliver Klee.
  39. Helmut Hummel wrote 09/17/20, 11:51

    Topic set to image-processing
  40. Benni Mack commented on patch set 16 V +1 CR +1 09/23/20, 14:45

    I'm not 100% fan of a) adding a DB field that does not do anything b) some naming things regarding PHP controllers + route names but that's a matter of taste & flavor, which I'm OK with. Thanks for your work here!
  41. Georg Ringer commented on patch set 16 09/28/20, 12:18

    ThumbnailViewHelper.php:25

    should this still stay in here? I would suggest removing it and creating an forge issue only
  42. Markus Klein commented on patch set 16 09/28/20, 12:53

    ProcessedFile.php:373

    why is this line removed?

    ProcessedFile.php:434

    useless phpdoc, please remove
  43. Markus Klein commented on patch set 16 V -1 CR -1 09/28/20, 12:57

    ImageProcessController.php:76

    this is extremely dangerous and wrong! This creates the same number of lock-files on HDD (or worst case semaphores in the OS) as files available within TYPO3! With semaphores, this can ultimately kill your entire server!

    FileLocalProcessingAspect.php:51

    IMO a simple `if` would be nicer
  44. Markus Klein commented on patch set 16 09/28/20, 13:00

    ImageProcessController.php:76 Reply

    A correct implementation is to use 1 lock-file to control the critical section here and read/store here which files are processed (queue or whatever). The lock resource under the hood (file or semaphore or ...) is NEVER removed, as we cannot determine if a process is still blocked (waiting) on this lock. compare to the locking-implementation in TSFE please.
  45. Markus Klein commented on patch set 16 09/28/20, 13:02

    BackendUtility.php:1168

    todo here as well
  46. Helmut Hummel commented on patch set 16 09/28/20, 15:27

    > Patch Set 16: Verified-1 Code-Review-1 > > (2 comments)

    ImageProcessController.php:76 Reply

    Imho the impact of locking is super different to frontend cache creation. Files are processed exactly once and then live there basically forever and no lock resource will be consumed for them any more. This means, the number of semaphores and/or lock files depends on the number of NEWLY to be processed files in ONE request, AND the locks are removed pretty quickly as well. I don't see any scenario where a critical limitation of lock files can be reached (other than an uncached homepage that is requested to be rendered a million times in a couple of seconds). Especially, since this is the implementation for backend image processing only. For what scenarios exactly do you expect things to be worse than the current state of backend image preview processing?
  47. Helmut Hummel commented on patch set 16 09/28/20, 15:38

    BackendUtility.php:1168 Reply

    Yes. This is something for a different change.

    ThumbnailViewHelper.php:25 Reply

    I don't care. If it is really benefitial to hide potential deprecation opportunities from the code base, I'll hide them.

    FileLocalProcessingAspect.php:51 Reply

    Is this a blocker?

    ProcessedFile.php:373 Reply

    Because processed files don't have a pid column and never had one.

    ProcessedFile.php:434 Reply

    also a blocker?
  48. Helmut Hummel commented on patch set 16 09/28/20, 15:50

    ImageProcessController.php:76 Reply

    but fine with me. I'll remove the locking when it is considered more resource friendly and less dangerous to processes images multiple times (like it is currently done)

    BackendUtility.php:1168 Reply

    Done

    ThumbnailViewHelper.php:25 Reply

    Done

    FileLocalProcessingAspect.php:51 Reply

    Done

    ProcessedFile.php:373 Reply

    Done

    ProcessedFile.php:434 Reply

    Done
  49. Helmut Hummel uploaded patch set 17 09/28/20, 15:51

  50. TYPO3com voted on patch set 17 V -1 09/28/20, 16:03 Completed build in 12m 08s on Mon, 28 Sep, 04:03 PM Test Summary: 3 of 74190 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6046

  51. Markus Klein commented on patch set 17 09/28/20, 21:18

    ImageProcessController.php:76 Reply Unresolved

    I am of course fine with locking! But please be aware that ->release() does NOT remove the lock's underlying resource. Since you never destroy the lock (and you can't otherwise it wouldn't work as intended), the lock's resource stays. Suggestion: Since you already removed the code again here, I create a follow-up patch adding the locking back?
  52. Helmut Hummel voted on patch set 17 CR -2 10/04/20, 10:37

  53. Helmut Hummel uploaded patch set 18 10/05/20, 11:35

  54. TYPO3com voted on patch set 18 V -1 10/05/20, 11:49 Completed build in 13m 34s on Mon, 5 Oct, 11:49 AM Test Summary: 3 of 74228 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6238

  55. Helmut Hummel uploaded patch set 19 10/05/20, 15:25

  56. TYPO3com voted on patch set 19 V +1 10/05/20, 15:41 Completed build in 15m 39s on Mon, 5 Oct, 03:41 PM Test Summary: 73743 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6243

  57. Helmut Hummel voted on patch set 19 CR 0 10/05/20, 18:00

  58. Helmut Hummel uploaded patch set 20 10/05/20, 19:29

  59. TYPO3com voted on patch set 20 V -1 10/05/20, 19:42 Completed build in 12m 39s on Mon, 5 Oct, 07:42 PM Test Summary: 73743 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6249

  60. Helmut Hummel uploaded patch set 21 10/06/20, 11:59

  61. TYPO3com voted on patch set 21 V +1 10/06/20, 12:15 Completed build in 15m 22s on Tue, 6 Oct, 12:15 PM Test Summary: 73785 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6270

  62. Markus Klein commented on patch set 21 10/06/20, 23:02

    Very lovely! The only thing I'm not entirely sure about yet is the naming of Locker. IMO this is a bit too generic, since we employ a very specific locking scheme there, tailored for this kind of "caching" algorithm.
  63. Helmut Hummel commented on patch set 21 10/16/20, 11:13

    > Patch Set 21: > > Very lovely! > The only thing I'm not entirely sure about yet is the naming of Locker. > IMO this is a bit too generic, since we employ a very specific locking scheme there, tailored for this kind of "caching" algorithm. I agree, I only could not come up with a better name. Can you?
  64. Markus Klein commented on patch set 21 10/19/20, 14:41

    > Patch Set 21: > > > Patch Set 21: > > > > Very lovely! > > The only thing I'm not entirely sure about yet is the naming of Locker. > > IMO this is a bit too generic, since we employ a very specific locking scheme there, tailored for this kind of "caching" algorithm. > > I agree, I only could not come up with a better name. Can you? I thought about it: - RequestSerializer - Serializer - ResourceMutex What do you think?
  65. Helmut Hummel commented on patch set 21 10/21/20, 13:21

    > I thought about it: Thanks! > - RequestSerializer > - Serializer Hm, this thing does not really serlialize something, does it? > - ResourceMutex Also a bit opaque for me personally, but could kind of work out
  66. Markus Klein commented on patch set 21 10/21/20, 13:34

    > Patch Set 21: > > > I thought about it: > > Thanks! > > > - RequestSerializer > > - Serializer > > Hm, this thing does not really serlialize something, does it? It serializes the parallel requests trying to do the same task. That was my thought. > > > - ResourceMutex > > Also a bit opaque for me personally, but could kind of work out
  67. Helmut Hummel commented on patch set 21 10/26/20, 13:02

    > Patch Set 21: > It serializes the parallel requests trying to do the same task. That was my thought. Ah, got it. Still don't think it is what this thing does. Let me ask differently: Is there a use case for pure Locking API, without access lock? If not, I'd tend to make it internal and only always use the locker, when locking is required. That was my thought for giving it a very generic name
  68. Markus Klein commented on patch set 21 10/26/20, 19:53

    > Patch Set 21: > > > Patch Set 21: > > > It serializes the parallel requests trying to do the same task. That was my thought. > > Ah, got it. Still don't think it is what this thing does. > > Let me ask differently: Is there a use case for pure Locking API, without access lock? > > If not, I'd tend to make it internal and only always use the locker, when locking is required. That was my thought for giving it a very generic name Of course there is. Here is a real-world example from our conference management system: $locker = GeneralUtility::makeInstance(LockFactory::class)->createLocker($this->name); if ($locker->acquire()) { Session::setUser('paymentFormId', $formHash); $locker->release(); ($this->name is hardcoded of course)
  69. Helmut Hummel uploaded patch set 22 11/05/20, 10:54

  70. Helmut Hummel commented on patch set 21 11/05/20, 10:55

    > Of course there is. Here is a real-world example from our conference management system: Alright. Went for ResourceMutex then
  71. TYPO3com voted on patch set 22 V +1 11/05/20, 11:07 Completed build in 12m 53s on Thu, 5 Nov, 11:07 AM Test Summary: 73593 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7125

  72. Benni Mack commented on patch set 22 11/05/20, 14:48

    Context.php:90

    do we need this to be included at all times?
  1. Markus Klein commented on patch set 22 11/06/20, 10:45

    > Patch Set 21: > > > Of course there is. Here is a real-world example from our conference management system: > > Alright. Went for ResourceMutex then +1 Thanks
  2. Markus Klein commented on patch set 22 11/06/20, 10:46

    Context.php:90 Reply

    What do you mean? The aspect is very cheap, it's only a bool.
  3. Benni Mack commented on patch set 22 11/12/20, 08:55

    Context.php:90 Reply

    sure, but should we add it at any times by default? I also wondered why the others were added on __construct() at any times (was introduced in v10) because the Context should be something that consists of a lot of aspects in the future, and we do not have to keep all aspects all the time. e.g. "typoscript", "preview" etc. are frontend only (thank god, "preview" was not added like that)
  4. Markus Klein uploaded patch set 23 11/12/20, 20:14

  5. Markus Klein uploaded patch set 24 11/12/20, 20:15

  6. Markus Klein commented on patch set 24 CR +1 11/12/20, 20:16

    Context.php:90 Reply

    Done
  7. TYPO3com voted on patch set 23 V +1 11/12/20, 20:30 Completed build in 16m 10s on Thu, 12 Nov, 08:30 PM Test Summary: 73623 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7276

  8. TYPO3com voted on patch set 24 V -1 11/12/20, 20:37 Completed build in 16m 32s on Thu, 12 Nov, 08:37 PM Test Summary: 3 of 74108 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7277

  9. TYPO3com commented on patch set 24 11/12/20, 21:19 Completed build in 12m 08s on Thu, 12 Nov, 09:19 PM Test Summary: 3 of 74108 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7278

  10. Markus Klein commented on patch set 24 11/12/20, 21:24

    GifBuilder.php:673 Unresolved

    Helmut, can you please help me out with those lines? Why do you set the aspect first and then query it again? I think those two are meant to be switched in order.
  11. Markus Klein voted on patch set 24 CR -1 11/12/20, 21:29

  12. Markus Klein uploaded patch set 25 11/12/20, 21:38

  13. Markus Klein voted on patch set 25 V +1 CR +1 11/12/20, 21:38

  14. Markus Klein uploaded patch set 26 11/12/20, 21:41

  15. Markus Klein uploaded patch set 27 11/12/20, 21:44

  16. Markus Klein voted on patch set 27 V +1 CR +1 11/12/20, 21:47

  17. TYPO3com voted on patch set 25 V -1 11/12/20, 21:47 Completed build in 08m 33s on Thu, 12 Nov, 09:47 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7279

  18. TYPO3com voted on patch set 26 V -1 11/12/20, 22:09 Completed build in 28m 08s on Thu, 12 Nov, 10:09 PM Test Summary: 9 of 74108 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7280

  19. TYPO3com voted on patch set 27 V -1 11/12/20, 22:16 Completed build in 30m 47s on Thu, 12 Nov, 10:16 PM Test Summary: 6 of 74108 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7281

  20. Markus Klein uploaded patch set 28 11/13/20, 10:11

  21. TYPO3com voted on patch set 28 V +1 11/13/20, 10:22 Completed build in 10m 55s on Fri, 13 Nov, 10:22 AM Test Summary: 73623 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7284

  22. Markus Klein voted on patch set 28 V +1 CR +1 11/13/20, 10:28

  23. Georg Ringer voted on patch set 28 V +1 CR +1 11/13/20, 10:34

  24. Georg Ringer voted on patch set 28 V +2 CR +2 11/14/20, 06:42

  25. Georg Ringer merged patch set 29 11/14/20, 19:16