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

Introduce mechanism to interrupt TrackingEventProcessor worker threads #2041

Merged
merged 6 commits into from Dec 21, 2021

Conversation

smcvb
Copy link
Member

@smcvb smcvb commented Dec 14, 2021

This pull request adjusts the TrackingEventProcessor to introduce a solution to interrupt worker threads.
It does so by adjusting the WorkerLauncher and TrackingSegmentWorker Runnable implementations into Worker implementations.
The Worker interface, in turn, extends Runnable, and provides some flexibility to store and identify threads.

This change stores every Thread constructed by the ThreadFactory in a Map.
This map is traversed on the private awaitTermination method, upon which it invokes join for every thread present.
Axon invokes the join method with a so-called workerTerminationTimeout, configurable through the TrackingEventProcessorConfiguration if necessary.

Introducing this functionality has the effect that the TrackingEventProcessor no longer blocks an application shut down when the eventAvailabilityTimeout exceeds the configured application shut down timeout.
That makes this pull request is a follow-up from the discussions in issue #1981.

Add missing coverage profile
Add missing coverage profile
Introduce a mechanism to interrupt the worker threads in the TEP on a
shutdown . Thus, both the WorkerLauncher and TrackingSegmentWorker. This
 ensures a TEP with a eventAvailabilityTimeout exceeding the shutdown
 timeout doesn't unnecessarily block the shutdown process

#enhancement/tep-worker-interruption
@smcvb smcvb added Type: Enhancement Use to signal an issue enhances an already existing feature of the project. Priority 3: Could Low priority. Issues that are nice to have but have a straightforward workaround. Status: In Progress Use to signal this issue is actively worked on. labels Dec 14, 2021
@smcvb smcvb added this to the Release 4.6.0 milestone Dec 14, 2021
@smcvb smcvb requested a review from abuijze December 14, 2021 12:36
@smcvb smcvb self-assigned this Dec 14, 2021
Trigger an interrupt() when a thread fails to complete within the configured timeout.
@sonarcloud
Copy link

sonarcloud bot commented Dec 21, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@smcvb
Copy link
Member Author

smcvb commented Dec 21, 2021

Discussed the implementation locally, ironing out some misses in commit 696d8f5. With that, the review is done. As such, I will merge the pull request.
Sonar Cloud's result is ignored in this case since it doesn't aggregate the results from the integration-test module.

@smcvb smcvb merged commit 07b88d2 into master Dec 21, 2021
@smcvb smcvb deleted the enhancement/tep-worker-interruption branch December 21, 2021 12:12
@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 Dec 21, 2021
@smcvb smcvb modified the milestones: Release 4.6.0, Release 4.5.13 Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority 3: Could Low priority. Issues that are nice to have but have a straightforward workaround. Status: Resolved Use to signal that work on this issue is done. Type: Enhancement Use to signal an issue enhances an already existing feature of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants