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

Fix scheduled executor leak #11227

Merged

Conversation

@mmedenjak
Copy link
Contributor

@mmedenjak mmedenjak commented Aug 25, 2017

The workQueue inside LoggingScheduledExecutor contains wrapped
futures of scheduled tasks. This is because we decorate tasks in
LoggingScheduledExecutor.decorateTask.
When we were cancelling the task, we delegated cancellation to the
delegate which tries to remove itself from the workQueue. The
workQueue though doesn't contain the delegate but rather contains the
decorated delegate. This causes the remove to fail without any
message and causes the leak.
To fix this, after we call cancel() on the delegate, we manually
remove the decorator from the workQueue.

Fixes : #11221

(cherry picked from commit a594ec2)

@mmedenjak mmedenjak added this to the 3.8.5 milestone Aug 25, 2017
Copy link
Contributor

@Donnerbart Donnerbart left a comment

Looks good to me

The workQueue inside LoggingScheduledExecutor contains wrapped
futures of scheduled tasks. This is because we decorate tasks in
LoggingScheduledExecutor.decorateTask.
When we were cancelling the task, we delegated cancellation to the
delegate which tries to remove itself from the workQueue. The
workQueue though doesn't contain the delegate but rather contains the
decorated delegate. This causes the remove to fail without any
message and causes the leak.
To fix this, after we call cancel() on the delegate, we manually
remove the decorator from the workQueue.

Fixes : #11221
@mmedenjak mmedenjak force-pushed the mmedenjak:scheduled-executor-leak-backport branch from 61a0b0f to 24a06fa Aug 28, 2017
@jerrinot jerrinot merged commit 59209a6 into hazelcast:maintenance-3.x Aug 28, 2017
1 check passed
1 check passed
default Test PASSed.
Details
@mmedenjak mmedenjak deleted the mmedenjak:scheduled-executor-leak-backport branch Aug 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.