Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
The workQueue inside LoggingScheduledExecutor contains wrapped
Fixes : #11221
(cherry picked from commit a594ec2)
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