88556[BUGFIX] Parallel execution of non-parallel scheduler task
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Stefan Bürk +1
-
Verified V +2 Done
- Christian Kuhn +2
- Stefan Bürk +1
- core-ci +1 CI
Issues 1
Files 2
Review log 2228
Show 23 earlier messages
-
Adam Koppe uploaded patch set 1 03/10/25, 13:10
-
Adam Koppe commented on patch set 1 03/10/25, 13:17
The changes described in the third and fourth paragraphs may be too much for patch level change. Please let me know what you think! -
core-ci voted on patch set 1 V -1 03/10/25, 13:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75416
-
Adam Koppe uploaded patch set 2
V -103/10/25, 13:35 -
core-ci voted on patch set 2 V -1 03/10/25, 13:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75418
-
Adam Koppe uploaded patch set 3
V -103/10/25, 16:36 -
core-ci voted on patch set 3 V +1 03/10/25, 16:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75430
-
Benni Mack updated the commit message in patch set 4
V +103/26/25, 09:34 -
Benni Mack rebased onto patch set 5 03/26/25, 09:34
-
core-ci voted on patch set 4 V +1 03/26/25, 09:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76363
-
core-ci voted on patch set 5 V +1 03/26/25, 09:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76364
-
Andreas Kienast commented on patch set 5 CR -1 03/26/25, 10:15
SchedulerTaskRepository.php:462Why not a simple `while`?SchedulerTaskRepository.php:503`assert()` must be avoided in production mode as it may get disabled in php.ini via `zend.assertions = -1`. -
Adam Koppe commented on patch set 5 03/26/25, 10:52
Thank you for your review @akienast@scripting-base.de. I'm not sure about the exact details of the adjustments you want to see. I'm waiting for your response before implementing them.SchedulerTaskRepository.php:462ReplyDo you mean `while (true) { ... }` or `while (($row = $this->findRecordByUid($task->getTaskUid()) !== null) { ... }`? For the first one I don't know the different to the `for (;;) { ... }` syntax so there was no reasoning for either one from my side. I didn't use the complex while variant with the exception thrown below the loop so readers interested in what happens when no row could be SELECT-ed don't need to read most of the function body.SchedulerTaskRepository.php:503ReplyThe `assert()` here primarily serves as a hint for code readers, so I don't think it is an issue if system administrators disable it. A properly behaving database will never return anything but 0 or 1 because we use a concrete value for the `uid` primary key field in the WHERE clause. What do you suggest instead? Throwing a \RuntimeException? -
Benni Mack uploaded patch set 6
CR -1V +103/26/25, 11:00 -
core-ci voted on patch set 6 V +1 03/26/25, 11:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76367
-
Stefan Bürk commented on patch set 6 03/27/25, 22:11
SchedulerTaskRepository.php:462ReplyBenni changed it already. Not sure, if we really need a loop here with "updated = 1" as only abort condition, doing data retrival and blindly updating over and over again. Not tested, but maybe using the locking framework may be a usefull way to work with block/waiting lock aquiring instead if a loop may be a better (readable) solution here. (Just thinking). -
Adam Koppe commented on patch set 6 03/28/25, 09:48
SchedulerTaskRepository.php:462ReplyThe use of an application level lock (Core\Locking) around the SELECT and UPDATE statements would hurt the most common case. Which is that the first UPDATE statement modifies exactly one row and the loop exits within the first iteration. Getting into the second iteration of the loop is very rare. I wasn't able to get it reliably, even with my test setup https://github.com/adamkoppede/typo3-parallel-scheduler-task-processing-test. -
Adam Koppe commented on patch set 6 03/30/25, 08:07
Reply
DoneSchedulerTaskRepository.php:503ReplyThread marked as resolved, as @benni@typo3.org removed both usages of `assert()`. -
Christian Kuhn commented on patch set 6 CR -1 04/09/25, 10:17
very clean change and well described. temp -1, reviewing in details now. -
Christian Kuhn commented on patch set 6 04/09/25, 10:37
SchedulerTaskRepository.php:497this is pretty clever: adding serialized_executions to 'where' makes this de facto atomic, and the next loop run will try again if the first try failed. (just commenting this here in case anyone stumbles on this in the future again). -
Christian Kuhn commented on patch set 6 04/09/25, 10:38
SchedulerTaskRepository.php:462Replyi think the solution is clever and we can go with this. -
Christian Kuhn commented on patch set 6 04/09/25, 10:39
SchedulerTaskRepository.php:550this is the same approach as in addExecutionToTask() -
Christian Kuhn commented on patch set 6 04/09/25, 10:39
Reply
i think it's fine. thank you! -
Christian Kuhn commented on patch set 6 04/09/25, 10:43
SchedulerTaskRepository.php:466this exception is quite important too: in case a task has been removed in the first loop, the while would exit here if it can't find the row anymore. -
Christian Kuhn commented on patch set 6 CR +1 V +1 04/09/25, 10:50
clean and clever patch! many thanks!Scheduler.php:196this is slightly convoluted but a working solution. i personally would probably not have worked with finally here and would have duplicated the finally code, but that's matter of taste. let's keep it like this! -
Stefan Bürk voted on patch set 6 CR +1 V +1 04/09/25, 10:51
-
Christian Kuhn voted on patch set 6 CR +2 V +2 04/09/25, 10:51
-
Christian Kuhn merged patch set 7 04/09/25, 11:12