Fixes #6703:修复 Admin 关闭时未释放上游健康检查线程池 - #6921
Open
BobSong-dev wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6703
背景
UpstreamCheckService在启动健康检查任务时会创建两个线程池:executor:负责定时调度invokeExecutor:负责执行实际的健康检查请求原来的关闭逻辑只停止了
executor,invokeExecutor没有被关闭。这样在 Admin 容器退出后,健康检查相关的后台任务仍可能继续运行。修改内容
在
close()中补充关闭invokeExecutor,并保留空值判断,避免未初始化时出现异常。同时补充单测,确认关闭流程会停止两个线程池。
验证
验证已通过:
UpstreamCheckServiceTest: 10 tests run Failures: 0 Errors: 0 Skipped: 1(原有禁用用例) BUILD SUCCESS