Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Use dedicated connection for EventStore #5005

Closed
wants to merge 4 commits into from

Conversation

bwaidelich
Copy link
Member

@bwaidelich bwaidelich commented Apr 22, 2024

Use a dedicated DBAL Connection for the DoctrineEventStore in order to prevent nested transactions potentially leading to RuntimeException of

A transaction is active already, can't commit events!

As a result, the doctrine:migrate and cr:setup commands can be skipped during CI

@mhsdesign
Copy link
Member

Yes i observed that already once in ci ... locally it works without ... probably because stuff (schema) is already warmed up?

@bwaidelich
Copy link
Member Author

@mhsdesign The error is

RuntimeException: Failed to acquire checkpoint lock for subscriber "Neos\Neos\FrontendRouting\Projection\DocumentUriPathProjection_Original" because a transaction is active already

I guess this is only implicitly related. I'll check again once #4988 is merged

@mhsdesign mhsdesign marked this pull request as draft April 22, 2024 15:39
@bwaidelich
Copy link
Member Author

grml, this isn't solved wiht #4988 it seems – I applied the fix there and checks still fail.
But The actual exception is now revealed and this can be reproduced locally by removing all Flow/Neos tables and running:

../../bin/behat -f progress --strict --no-interaction '-vvv' '--stop-on-failure' '-c' 'Neos.Neos/Tests/Behavior/behat.yml'  

=>

001 Scenario: Match homepage URL                                     # Features/FrontendRouting/Basic.feature:69
      When the command CreateRootWorkspace is executed with payload: # Features/FrontendRouting/Basic.feature:30
        RuntimeException: A transaction is active already, can't commit events! in Packages/Libraries/neos/eventstore-doctrineadapter/src/DoctrineEventStore.php:95

So this is the line that fails. I'll investigate..

bwaidelich added 2 commits May 1, 2024 11:53
in order to prevent nested transactions potentially leading to RuntimeException of

    A transaction is active already, can't commit events!
@bwaidelich bwaidelich changed the title BUGFIX: Remove doctrine migrate and cr setup commands from behat scripts BUGFIX: Use dedicated connection for EventStore May 1, 2024
@bwaidelich
Copy link
Member Author

I can confirm that the last version works in conjunction with the reworked catchup:
image

If we were to create a dedicated connection per projection, it would probably work here as well – and maybe that even makes sense since they have their independent transaction boundaries

mhsdesign added a commit to mhsdesign/neos-development-collection that referenced this pull request May 17, 2024
mhsdesign added a commit to mhsdesign/neos-development-collection that referenced this pull request May 17, 2024
neos-bot pushed a commit to neos/contentgraph-doctrinedbaladapter that referenced this pull request May 17, 2024
@mhsdesign
Copy link
Member

mhsdesign commented Jun 21, 2024

I have encountered the bug also in the NodeTemplates Ci (see Flowpack/Flowpack.NodeTemplates@f37b6c4)

The first error is:

Neos.ContentRepository.Core/Classes/EventStore/EventPersister.php:47

RuntimeException: A transaction is active already, can't commit events!


and succeeding errors:

Neos.ContentRepository.Core/Classes/Infrastructure/DbalCheckpointStorage.php:88

RuntimeException: Failed to acquire checkpoint lock for subscriber "Neos\ContentRepository\Core\Projection\ContentStream\ContentStreamProjection" because a transaction is active already

@bwaidelich
Copy link
Member Author

This will hopefully be resolved with #4988 once and for all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants