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

Refresh StoredEvent object and confirm still unpublished #36

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

benr77
Copy link
Contributor

@benr77 benr77 commented Jun 2, 2024

In extremely high concurrency situations, it was possible for the entities loaded in PublishDomainEventSubscriber::publishEvents() to be published by another process, before the subsequent lock was acquired.

This commit enables a Doctrine "refresh" of the entity, inside the lock, which then allows us to perform a reliable lookup of the entity's published status, and then only publish if it is still unpublished.

In extremely high concurrency situations, it was possible for the
entities loaded in `PublishDomainEventSubscriber::publishEvents()` to be
published by another process, before the subsequent lock was acquired.

This commit enables a Doctrine "refresh" of the entity, inside the lock,
which then allows us to perform a reliable lookup of the entity's
published status, and then only publish if it is still unpublished.
@benr77 benr77 force-pushed the fix-concurrency-problems branch from 1147ceb to 9f2eee9 Compare June 2, 2024 07:05
@benr77 benr77 merged commit dddcf07 into master Jun 2, 2024
20 checks passed
@benr77 benr77 deleted the fix-concurrency-problems branch June 2, 2024 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant