Skip to content

1026274: Worker Framework Shutdown hanging #226

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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,11 @@ public void start() {
public void stop() {
LOG.info("Worker stop requested, allowing in-progress tasks to complete.");
workerQueue.shutdownIncoming();
while (!wtp.isIdle()) {
try {
//The grace period will expire and the process killed so no need for time limit here
LOG.trace("Awaiting the Worker Thread Pool to become idle, {} tasks in the backlog.",
wtp.getBacklogSize());
Thread.sleep(1000);
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
LOG.trace("Worker Thread Pool is idle.");
wtp.shutdown();
try {
wtp.awaitTermination(10_000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
LOG.warn("Shutdown interrupted", e);
wtp.awaitTermination(5, TimeUnit.MINUTES);
} catch (final InterruptedException e) {
LOG.error("Worker stop interrupted, in-progress tasks may not have completed.", e);
Thread.currentThread().interrupt();
}
workerQueue.shutdown();
Expand Down