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

Fixed ExpirationService not shutting down Executor #835

Merged
merged 1 commit into from
May 1, 2024

Conversation

hylkevds
Copy link
Collaborator

When shutting down the server the Executor Threads in ScheduledExpirationService instances were not terminated, resulting in a hanging server that would not shut down.

@hylkevds hylkevds requested a review from andsel April 30, 2024 06:49
Copy link
Collaborator

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is correct, just a nit pick on the the visibility of the newly introduced field.

@@ -25,13 +25,14 @@ public class ScheduledExpirationService<T extends Expirable> {
private final ScheduledFuture<?> expiredEntityTask;
private final Clock clock;
private final Consumer<T> action;
ScheduledExecutorService actionsExecutor;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that actionsExecutor is assigned only once in the constructor, this can be

Suggested change
ScheduledExecutorService actionsExecutor;
private final ScheduledExecutorService actionsExecutor;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, fixed :)

Copy link
Collaborator

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andsel andsel merged commit 432b3f0 into moquette-io:main May 1, 2024
4 checks passed
@andsel
Copy link
Collaborator

andsel commented May 1, 2024

Thank's @hylkevds for fixing it!

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.

None yet

2 participants