Review main Merged

95581[BUGFIX] Hand correlation ids to the remaining history writers

Benni Mack CR +2 V +2 Normal +139 −12 updated 09/04/26, 08:56

Commit message

Since #110586 and #110588 every history writer that belongs to a data
handler operation writes below the correlation scope of that
operation, except for three.

ExtbaseHistoryTracker passed no correlation id at all, so its entries
fell back to an id derived from the record alone, without any scope.
There is no data handler run to inherit from here, so the new
PersistenceCorrelationScope holds one scope per Extbase persistence
run: Backend starts a new one with every commit, and the tracker puts
all entries of that run below it. A run is the counterpart of one
data handler run, and scoping per run rather than per request keeps
long running processes such as messenger workers from piling up
unrelated changes below a single id.

DataHandlerInternalWorkspaceTablesHook discards all records of a
deleted workspace through a data handler of its own, and
EditDocumentController runs "save and duplicate" as a second data
handler. Both started a new random scope instead of continuing the one
they belong to, and receive the correlation id of the surrounding
operation now.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 1012

  1. Benni Mack uploaded patch set 1 09/02/26, 21:20

  2. core-ci voted on patch set 1 V +1 09/02/26, 21:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107683

  3. Stefan Bürk commented on patch set 1 09/03/26, 09:58

    ExtbaseHistoryTracker.php:58

    I'm unsure here. I guess we should have either: * a) a event this listener listens to (notification) to recalculate the correlationId and set it * b) a method to recalculate the correlationId and set it getting a `Random` instance passed. Background: Long running worker code (MessageBus consumer and similar implementations) doing stuff with extbase reacting on async events/messages would perists everything triggered from different places over longer periods (1h, 30min) with the same correlationId - and I postulate that is not good. That means we should at least provide something which can be publicly calles, for example before each message (messenger middleware) to recalculate that and have that at least as a `important` restfile. Granted, not many people are doing that - but a couple of them do - and forcing them to use php native reflection api for the next "not communicated" place/state after long hour of debugging sessions is something we should at least talk about it. Not sure if my suggestions are the only ways of if there is a better approach. @benni@typo3.org What do you think ?
  4. Benni Mack uploaded patch set 2 V +1 09/03/26, 20:22

  5. Benni Mack commented on patch set 2 09/03/26, 20:22

    ExtbaseHistoryTracker.php:58 Reply

    You are right, I built a wrapper now that can reset the correlationId for each "transaction"
  6. core-ci voted on patch set 2 V +1 09/03/26, 20:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107780

  7. Simon Schaufelberger voted on patch set 2 CR +1 V +1 09/04/26, 00:49

  8. Stefan Bürk commented on patch set 2 CR -1 09/04/26, 07:04

    Reviewing/testing ...
  9. Stefan Bürk voted on patch set 2 CR +1 V +1 09/04/26, 08:17

  10. Stefan Bürk commented on patch set 2 09/04/26, 08:18

    Reply

    Done
  11. Benni Mack voted on patch set 2 CR +2 V +2 09/04/26, 08:56

  12. Benni Mack merged patch set 3 09/04/26, 08:56