Skip to content

Shutdown SplitSource executors during cleanup#19743

Merged
pettyjamesm merged 2 commits intotrinodb:masterfrom
pettyjamesm:cleanup-test-split-source
Nov 15, 2023
Merged

Shutdown SplitSource executors during cleanup#19743
pettyjamesm merged 2 commits intotrinodb:masterfrom
pettyjamesm:cleanup-test-split-source

Conversation

@pettyjamesm
Copy link
Copy Markdown
Member

@pettyjamesm pettyjamesm commented Nov 14, 2023

Description

Follows up after #19369 and ensures that the new SplitManager executor is shut down during cleanup so that threads aren't kept around unnecessarily in test environments.

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@cla-bot cla-bot bot added the cla-signed label Nov 14, 2023
@pettyjamesm pettyjamesm changed the title Shutdown executor after TestBufferingSplitSource Shutdown SplitSource executors during cleanup Nov 14, 2023
@pettyjamesm pettyjamesm force-pushed the cleanup-test-split-source branch from ee1f921 to 9489441 Compare November 15, 2023 15:38
@PreDestroy
public void shutdown()
{
executorService.shutdown();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the benefit of doing this? The underlying pool uses daemon threads, so they'll all terminate when the VM stops. shutdown() does not wait for or interrupt the threads, so it won't do much except for preventing new tasks from being submitted.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In a typical deployment situation, this has no effect since the SplitManager is created only once. However, in tests this ensures that the threadpool is shutdown and the threads stopped earlier than they would if the usual cached threadpool 60 second idle timeout is reached.

@pettyjamesm pettyjamesm merged commit 14b33c7 into trinodb:master Nov 15, 2023
@pettyjamesm pettyjamesm deleted the cleanup-test-split-source branch November 15, 2023 16:47
@github-actions github-actions bot added this to the 434 milestone Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants