[add] Add stale connection checker to replace broken connections#12
Open
zark12138 wants to merge 1 commit intoshimingyah:masterfrom
Open
[add] Add stale connection checker to replace broken connections#12zark12138 wants to merge 1 commit intoshimingyah:masterfrom
zark12138 wants to merge 1 commit intoshimingyah:masterfrom
Conversation
[add] Add stale connection checker to replace broken connections [add] Add stale connection checker to replace broken connections
b0abe40 to
e45c180
Compare
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.
[add] Add stale connection checker to replace broken connections
针对 https://github.com/shimingyah/pool/issues/11的 修复
增加了一个异步扫描连接池的协程,用于维护连接池的健康
检测到类似的“僵尸连接”(不可用连接)会清理并重新插入
如下图的test所示,创建了一个只有一个连接的连接池,直接调用grpc的close()关闭连接之后,再次获取连接池中的连接将不再可用


这是引入此次pr的结果,异步协程会清理掉“僵尸连接”并重新插入一个正常的连接