Skip to content

Commit

Permalink
Shutdown server threads on server close
Browse files Browse the repository at this point in the history
This fix threads leak in tests.
  • Loading branch information
findepi committed Mar 16, 2022
1 parent 5b5b8c6 commit b1710ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void start()
public void stop()
{
nodeManager.removeNodeChangeListener(listener);
executor.shutdown();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ public void startPollingNodeStates()
pollWorkers();
}

@PreDestroy
public void destroy()
{
nodeStateUpdateExecutor.shutdown();
nodeStateEventExecutor.shutdown();
}

private void pollWorkers()
{
AllNodes allNodes = getAllNodes();
Expand Down

0 comments on commit b1710ed

Please sign in to comment.