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

Synchronize during Event Processor initialization #2756

Merged
merged 5 commits into from Jun 16, 2023

Conversation

smcvb
Copy link
Member

@smcvb smcvb commented Jun 16, 2023

To ensure no two (or more) threads can simultaneously initiate Event Processors in the EventProcessingModule, add a synchronize around the initialization.
To make the call slightly more efficient, first check if there are not event processor, then enter the synchronize-block, and then check for an empty event processors collection again.

In doing the above, this pull request resolves #2751.

Remove processor initialization from eventProcessors(), as it's fine for
 the processors to be initialized as part of the lifecycle handlers.
Furthermore, we should clarify that a buildConfiguration() does not mean
 everything is present due to said lifecycle handlers. Furthermore,
wherever tests expect a buildConfiguration() to lead to existing
EventProcessor should change their behavior to start the Configurer
instead.

#2751
@smcvb smcvb added Type: Bug Use to signal issues that describe a bug within the system. Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. Status: In Progress Use to signal this issue is actively worked on. labels Jun 16, 2023
@smcvb smcvb added this to the Release 4.7.6 milestone Jun 16, 2023
@smcvb smcvb requested review from abuijze and a team June 16, 2023 11:23
@smcvb smcvb self-assigned this Jun 16, 2023
@smcvb smcvb requested review from gklijs and CodeDrivenMitch and removed request for a team June 16, 2023 11:23
Synchronize during event processors initialization to ensure no two
threads can simultaneously initiatie event processors.

#2751
@smcvb smcvb changed the title Remove processor initialization from EventProcessingConfigurion#eventProcessors() Synchronize during Event Processor initialization Jun 16, 2023
Use AtomicBoolean instead of an Object

#2751
Move initialized boolean and make private

#2751
@smcvb smcvb merged commit 991b651 into axon-4.7.x Jun 16, 2023
4 of 5 checks passed
@smcvb smcvb deleted the bug/2751-processor-initialization branch June 16, 2023 16:51
@smcvb smcvb added Status: Resolved Use to signal that work on this issue is done. and removed Status: In Progress Use to signal this issue is actively worked on. labels Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. Status: Resolved Use to signal that work on this issue is done. Type: Bug Use to signal issues that describe a bug within the system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants